]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
logging: enable line buffering on stderr
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 20 Nov 2019 09:47:16 +0000 (10:47 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 2 Dec 2019 17:06:15 +0000 (18:06 +0100)
This should avoid mixed lines on console or in file log when multiple
processes will be logging messages at the same time.

logging.c

index 8b635a5ec721ea139a3a517efbbe782a855bfaac..87f263ed24d64595aa0f7e8a0930ff9fe32be175 100644 (file)
--- 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);
 }
 
 /* ================================================== */