summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorAndreas Ericsson <exon@op5.se>2005-11-16 23:38:29 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-17 04:34:26 (GMT)
commita8883288fa1240996a9c5715e060a88a03796fe0 (patch)
tree7e2a9e6f473aa367b6ce3753372ffb011dc436ad /daemon.c
parentfbba222f5de21aafa566430a8ae7cf6f4ab163b1 (diff)
downloadgit-a8883288fa1240996a9c5715e060a88a03796fe0.zip
git-a8883288fa1240996a9c5715e060a88a03796fe0.tar.gz
git-a8883288fa1240996a9c5715e060a88a03796fe0.tar.bz2
daemon.c: fix arg parsing bugs
Allow --init-timeout and --timeout to be specified without falling through to usage(). Make sure openlog() is called even if implied by --inetd, or messages will be sent to wherever LOG_USER ends up. Signed-off-by: Andreas Ericsson <ae@op5.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/daemon.c b/daemon.c
index e184752..2b81152 100644
--- a/daemon.c
+++ b/daemon.c
@@ -594,6 +594,7 @@ int main(int argc, char **argv)
}
if (!strcmp(arg, "--inetd")) {
inetd_mode = 1;
+ log_syslog = 1;
continue;
}
if (!strcmp(arg, "--verbose")) {
@@ -602,7 +603,6 @@ int main(int argc, char **argv)
}
if (!strcmp(arg, "--syslog")) {
log_syslog = 1;
- openlog("git-daemon", 0, LOG_DAEMON);
continue;
}
if (!strcmp(arg, "--export-all")) {
@@ -611,9 +611,11 @@ int main(int argc, char **argv)
}
if (!strncmp(arg, "--timeout=", 10)) {
timeout = atoi(arg+10);
+ continue;
}
if (!strncmp(arg, "--init-timeout=", 15)) {
init_timeout = atoi(arg+15);
+ continue;
}
if (!strcmp(arg, "--")) {
ok_paths = &argv[i+1];
@@ -626,9 +628,11 @@ int main(int argc, char **argv)
usage(daemon_usage);
}
+ if (log_syslog)
+ openlog("git-daemon", 0, LOG_DAEMON);
+
if (inetd_mode) {
fclose(stderr); //FIXME: workaround
- log_syslog = 1;
return execute();
}