X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=daemon.c;h=2b81152d7145c796374ec35d4c61676da42cb992;hb=942c1f53aef03cb3d8b5c39b38997a379c3fad20;hp=0c6182fb93fce6937ecb2634462f7f6b0a835662;hpb=4ae22d96fe9248dac4f26b1fc91154ba5e879799;p=git.git diff --git a/daemon.c b/daemon.c index 0c6182fb..2b81152d 100644 --- a/daemon.c +++ b/daemon.c @@ -1,5 +1,3 @@ -#include "cache.h" -#include "pkt-line.h" #include #include #include @@ -9,6 +7,8 @@ #include #include #include +#include "pkt-line.h" +#include "cache.h" static int log_syslog; static int verbose; @@ -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,10 +628,13 @@ 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 return execute(); - } else { - return serve(port); } + + return serve(port); }