From: Davin McCall Date: Thu, 26 Dec 2019 05:00:30 +0000 (+0000) Subject: Flush main log (as well) before exit X-Git-Tag: v0.8.1~13 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9697bda6200f6afb3c926328ac7a180dafa534f8;p=oweals%2Fdinit.git Flush main log (as well) before exit The console log is flushed before exit (with a timeout of 5 seconds), but the primary log was not flushed until now. --- diff --git a/src/dinit-log.cc b/src/dinit-log.cc index 990ffef..89c9f05 100644 --- a/src/dinit-log.cc +++ b/src/dinit-log.cc @@ -1,4 +1,3 @@ -#include #include #include @@ -282,7 +281,8 @@ void setup_main_log(int fd) bool is_log_flushed() noexcept { - return log_stream[DLOG_CONS].current_index == 0; + return log_stream[DLOG_CONS].current_index == 0 && + (log_stream[DLOG_MAIN].fd == -1 || log_stream[DLOG_MAIN].current_index == 0); } // Enable or disable console logging. If disabled, console logging will be disabled on the