From: Miroslav Lichvar Date: Wed, 26 Jul 2017 15:31:34 +0000 (+0200) Subject: logging: enable line buffering of file log X-Git-Tag: 3.2-pre2~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d70df3daab0020ba9ce9b0333a0c1c3f2a350ca1;p=thirdparty%2Fchrony.git logging: enable line buffering of file log The file log specified with the -l option should have the messages as soon as they are produced. --- diff --git a/logging.c b/logging.c index a87aca36..b39c4d52 100644 --- a/logging.c +++ b/logging.c @@ -188,6 +188,9 @@ LOG_OpenFileLog(const char *log_file) if (!f) LOG_FATAL("Could not open log file %s", log_file); + /* Enable line buffering */ + setvbuf(f, NULL, _IOLBF, BUFSIZ); + file_log = f; }