From d05e9fb2ec04545523f04909de51ec900616627c Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 20 Nov 2019 10:47:16 +0100 Subject: [PATCH] logging: enable line buffering on stderr This should avoid mixed lines on console or in file log when multiple processes will be logging messages at the same time. --- logging.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/logging.c b/logging.c index 8b635a5..87f263e 100644 --- a/logging.c +++ b/logging.c @@ -42,7 +42,7 @@ LOG_Severity log_min_severity = LOGS_INFO; /* Flag indicating we have initialised */ static int initialised = 0; -static FILE *file_log; +static FILE *file_log = NULL; static int system_log = 0; static int parent_fd = 0; @@ -68,7 +68,7 @@ void LOG_Initialise(void) { initialised = 1; - file_log = stderr; + LOG_OpenFileLog(NULL); } /* ================================================== */