diff options
author | Lennart Poettering <lennart@poettering.net> | 2010-05-18 05:10:52 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2010-05-18 05:10:52 +0200 |
commit | c8513d54d23a36fc84b2f0b96989da3041ad15bc (patch) | |
tree | c1126dbf706ff0a39a6fb6b2d6bf8046d939e8fc /src/log.c | |
parent | 710bd1434709402e557b03a684eb905b619477dc (diff) |
log: never close file descriptors < 3
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; } } |