From: Junio C Hamano Date: Wed, 25 Apr 2018 04:28:58 +0000 (+0900) Subject: Merge branch 'lw/daemon-log-destination' X-Git-Tag: v2.18.0-rc0~120 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/f9bcd751aaa8f9cb57bbe4f43f2c446f9aa523b3?ds=inline;hp=-c Merge branch 'lw/daemon-log-destination' Recent introduction of "--log-destination" option to "git daemon" did not work well when the daemon was run under "--inetd" mode. * lw/daemon-log-destination: daemon.c: fix condition for redirecting stderr --- f9bcd751aaa8f9cb57bbe4f43f2c446f9aa523b3 diff --combined daemon.c index fe833ea7de,7857169055..9d2e0d20ef --- a/daemon.c +++ b/daemon.c @@@ -611,7 -611,6 +611,7 @@@ static char *parse_host_arg(struct host if (strncasecmp("host=", extra_args, 5) == 0) { val = extra_args + 5; vallen = strlen(val) + 1; + loginfo("Extended attribute \"host\": %s", val); if (*val) { /* Split : at colon. */ char *host; @@@ -662,11 -661,9 +662,11 @@@ static void parse_extra_args(struct hos } } - if (git_protocol.len > 0) + if (git_protocol.len > 0) { + loginfo("Extended attribute \"protocol\": %s", git_protocol.buf); argv_array_pushf(env, GIT_PROTOCOL_ENVIRONMENT "=%s", git_protocol.buf); + } strbuf_release(&git_protocol); } @@@ -774,8 -771,14 +774,8 @@@ static int execute(void alarm(0); len = strlen(line); - if (pktlen != len) - loginfo("Extended attributes (%d bytes) exist <%.*s>", - (int) pktlen - len, - (int) pktlen - len, line + len + 1); - if (len && line[len-1] == '\n') { - line[--len] = 0; - pktlen--; - } + if (len && line[len-1] == '\n') + line[len-1] = 0; /* parse additional args hidden behind a NUL byte */ if (len != pktlen) @@@ -1459,7 -1462,7 +1459,7 @@@ int cmd_main(int argc, const char **arg die("base-path '%s' does not exist or is not a directory", base_path); - if (inetd_mode) { + if (log_destination != LOG_DESTINATION_STDERR) { if (!freopen("/dev/null", "w", stderr)) die_errno("failed to redirect stderr to /dev/null"); }