summaryrefslogtreecommitdiff
path: root/daemon.c
diff options
context:
space:
mode:
authorLucas Werkmeister <mail@lucaswerkmeister.de>2018-04-03 22:13:07 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-04-09 02:25:48 (GMT)
commite67d906d735166f2068f1e4cc393220483a97f30 (patch)
tree426596976e6283f4137f106ba68d893eb712dd6a /daemon.c
parent0c591cacba00a36af797fa3b6c4a4f12d342be86 (diff)
downloadgit-e67d906d735166f2068f1e4cc393220483a97f30.zip
git-e67d906d735166f2068f1e4cc393220483a97f30.tar.gz
git-e67d906d735166f2068f1e4cc393220483a97f30.tar.bz2
daemon.c: fix condition for redirecting stderr
Since the --log-destination option was added in 0c591cacb ("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 <mail@lucaswerkmeister.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'daemon.c')
-rw-r--r--daemon.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/daemon.c b/daemon.c
index fb538e3..7857169 100644
--- a/daemon.c
+++ b/daemon.c
@@ -1462,7 +1462,7 @@ int cmd_main(int argc, const char **argv)
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");
}