From d70df3daab0020ba9ce9b0333a0c1c3f2a350ca1 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 26 Jul 2017 17:31:34 +0200 Subject: [PATCH] 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. --- logging.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.47.3