diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/execute.c | 1 | ||||
-rw-r--r-- | src/log.c | 4 | ||||
-rw-r--r-- | src/log.h | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/src/execute.c b/src/execute.c index 250d53a424..065101431d 100644 --- a/src/execute.c +++ b/src/execute.c @@ -1016,6 +1016,7 @@ int exec_spawn(ExecCommand *command, /* Close sockets very early to make sure we don't * block init reexecution because it cannot bind its * sockets */ + log_forget_fds(); if (close_all_fds(socket_fd >= 0 ? &socket_fd : fds, socket_fd >= 0 ? 1 : n_fds) < 0) { r = EXIT_FDS; @@ -237,6 +237,10 @@ void log_close(void) { log_close_syslog(); } +void log_forget_fds(void) { + console_fd = kmsg_fd = syslog_fd = -1; +} + void log_set_max_level(int level) { assert((level & LOG_PRIMASK) == level); @@ -57,6 +57,7 @@ int log_get_max_level(void); int log_open(void); void log_close(void); +void log_forget_fds(void); void log_close_syslog(void); void log_close_kmsg(void); |