summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorMatthias Lederhofer <matled@gmx.net>2006-07-13 10:02:29 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-07-14 04:50:14 (GMT)
commitad8b4f56b5ec1e5385156c20d95649ea8cee6af4 (patch)
treee716507c3625deaa43efad974e4686473146b804 /daemon.c
parent8d5e26848d0ddd5063f078b0c34c6c48b68d0d94 (diff)
downloadgit-ad8b4f56b5ec1e5385156c20d95649ea8cee6af4.zip
git-ad8b4f56b5ec1e5385156c20d95649ea8cee6af4.tar.gz
git-ad8b4f56b5ec1e5385156c20d95649ea8cee6af4.tar.bz2
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: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/daemon.c b/daemon.c
index e096bd7..a7636bc 100644
--- a/daemon.c
+++ b/daemon.c
@@ -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;