summaryrefslogtreecommitdiff
path: root/src/log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/log.c')
-rw-r--r--src/log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/log.c b/src/log.c
index 5d17955e7e..7b4db4c77a 100644
--- a/src/log.c
+++ b/src/log.c
@@ -50,8 +50,10 @@ void log_close_console(void) {
if (console_fd < 0)
return;
- if (getpid() == 1 || console_fd != STDERR_FILENO) {
- close_nointr_nofail(console_fd);
+ if (getpid() == 1) {
+ if (console_fd >= 3)
+ close_nointr_nofail(console_fd);
+
console_fd = -1;
}
}