Skip to content

Commit e67d906

Browse files
lucaswerkmeistergitster
authored andcommitted
daemon.c: fix condition for redirecting stderr
Since the --log-destination option was added in 0c591ca ("daemon: add --log-destination=(stderr|syslog|none)", 2018-02-04) with the explicit goal of allowing logging to stderr when running in inetd mode, we should not always redirect stderr to /dev/null in inetd mode, but rather only when stderr is not being used for logging. Signed-off-by: Lucas Werkmeister <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0c591ca commit e67d906

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

daemon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1462,7 +1462,7 @@ int cmd_main(int argc, const char **argv)
14621462
die("base-path '%s' does not exist or is not a directory",
14631463
base_path);
14641464

1465-
if (inetd_mode) {
1465+
if (log_destination != LOG_DESTINATION_STDERR) {
14661466
if (!freopen("/dev/null", "w", stderr))
14671467
die_errno("failed to redirect stderr to /dev/null");
14681468
}

0 commit comments

Comments
 (0)