提交 ad8b4f56 编写于 作者: M Matthias Lederhofer 提交者: Junio C Hamano

daemon: use a custom die routine with syslog

Removed the git-daemon prefix from die() because no other call to die
does this.
Signed-off-by: NMatthias Lederhofer <matled@gmx.net>
Signed-off-by: NJunio C Hamano <junkio@cox.net>
上级 8d5e2684
......@@ -95,6 +95,12 @@ static void loginfo(const char *err, ...)
va_end(params);
}
static void NORETURN daemon_die(const char *err, va_list params)
{
logreport(LOG_ERR, err, params);
exit(1);
}
static int avoid_alias(char *p)
{
int sl, ndot;
......@@ -746,17 +752,14 @@ int main(int argc, char **argv)
usage(daemon_usage);
}
if (log_syslog)
if (log_syslog) {
openlog("git-daemon", 0, LOG_DAEMON);
if (strict_paths && (!ok_paths || !*ok_paths)) {
if (!inetd_mode)
die("git-daemon: option --strict-paths requires a whitelist");
logerror("option --strict-paths requires a whitelist");
exit (1);
set_die_routine(daemon_die);
}
if (strict_paths && (!ok_paths || !*ok_paths))
die("option --strict-paths requires a whitelist");
if (inetd_mode) {
struct sockaddr_storage ss;
struct sockaddr *peer = (struct sockaddr *)&ss;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册