From d58fd080caf9e83c0f67135e4e8dd1654401bbde Mon Sep 17 00:00:00 2001 From: Christian Kruse Date: Sat, 15 Feb 2014 01:29:12 +0100 Subject: [PATCH] flush stderr after a log message appears We had the problem that the log file appeared empty for a long time due to file buffers. Thus we call fflush() after every log message so the log file gets written out to disk quickly --- log.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/log.c b/log.c index e268b42a..be083b57 100644 --- a/log.c +++ b/log.c @@ -58,6 +58,8 @@ void stderr_log_with_level(const char *level_name, int level, const char *fmt, . vfprintf(stderr, fmt1, ap); va_end(ap); + + fflush(stderr); } }