From 9697bda6200f6afb3c926328ac7a180dafa534f8 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Thu, 26 Dec 2019 05:00:30 +0000 Subject: [PATCH] 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. --- src/dinit-log.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.25.1