{"thread":{"id":"2561","subject":"[PATCH] daemon.c: fix arg parsing bugs","startedAt":"2005-11-16T23:38:29Z","lastAt":"2005-11-16T23:38:29Z","messageCount":1,"participants":["Andreas Ericsson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"12063","messageId":"20051116233829.071CC5BF78@nox.op5.se","threadId":"2561","inReplyTo":null,"subject":"[PATCH] daemon.c: fix arg parsing bugs","fromName":"Andreas Ericsson","fromEmail":"exon@op5.se","sentAt":"2005-11-16T23:38:29Z","receivedAt":"2005-11-16T23:38:29Z","isPatch":true,"sender":{"key":"exon@op5.se","avatar":"https://gravatar.com/avatar/b948c4f759e868f8e721e545e37afe2cf89cfa8e2ee8b70a432f0d76aee39891?d=mp&s=160"},"body":"\nAllow --init-timeout and --timeout to be specified without falling\nthrough to usage().\n\nMake sure openlog() is called even if implied by --inetd, or messages\nwill be sent to wherever LOG_USER ends up.\n\nSigned-off-by: Andreas Ericsson <ae@op5.se>\n\n---\n\n daemon.c |    8 ++++++--\n 1 files changed, 6 insertions(+), 2 deletions(-)\n\napplies-to: 1e3fcf60526c196a46433e6947c9104ca236f230\n83a3edea8623834fd7827f80cad2af4927f5a19e\ndiff --git a/daemon.c b/daemon.c\nindex e184752..2b81152 100644\n--- a/daemon.c\n+++ b/daemon.c\n@@ -594,6 +594,7 @@ int main(int argc, char **argv)\n \t\t}\n \t\tif (!strcmp(arg, \"--inetd\")) {\n \t\t\tinetd_mode = 1;\n+\t\t\tlog_syslog = 1;\n \t\t\tcontinue;\n \t\t}\n \t\tif (!strcmp(arg, \"--verbose\")) {\n@@ -602,7 +603,6 @@ int main(int argc, char **argv)\n \t\t}\n \t\tif (!strcmp(arg, \"--syslog\")) {\n \t\t\tlog_syslog = 1;\n-\t\t\topenlog(\"git-daemon\", 0, LOG_DAEMON);\n \t\t\tcontinue;\n \t\t}\n \t\tif (!strcmp(arg, \"--export-all\")) {\n@@ -611,9 +611,11 @@ int main(int argc, char **argv)\n \t\t}\n \t\tif (!strncmp(arg, \"--timeout=\", 10)) {\n \t\t\ttimeout = atoi(arg+10);\n+\t\t\tcontinue;\n \t\t}\n \t\tif (!strncmp(arg, \"--init-timeout=\", 15)) {\n \t\t\tinit_timeout = atoi(arg+15);\n+\t\t\tcontinue;\n \t\t}\n \t\tif (!strcmp(arg, \"--\")) {\n \t\t\tok_paths = &argv[i+1];\n@@ -626,9 +628,11 @@ int main(int argc, char **argv)\n \t\tusage(daemon_usage);\n \t}\n \n+\tif (log_syslog)\n+\t\topenlog(\"git-daemon\", 0, LOG_DAEMON);\n+\n \tif (inetd_mode) {\n \t\tfclose(stderr); //FIXME: workaround\n-\t\tlog_syslog = 1;\n \t\treturn execute();\n \t}\n \n---\n0.99.9.GIT\n"}]}