From: Miroslav Lichvar Date: Wed, 20 Nov 2019 09:47:16 +0000 (+0100) Subject: logging: enable line buffering on stderr X-Git-Tag: 4.0-pre1~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d05e9fb2ec04545523f04909de51ec900616627c;p=thirdparty%2Fchrony.git 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. --- diff --git a/logging.c b/logging.c index 8b635a5e..87f263ed 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); } /* ================================================== */