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.
This commit is contained in:
Miroslav Lichvar 2017-07-26 17:31:34 +02:00
parent 554b9b06de
commit d70df3daab

View file

@ -188,6 +188,9 @@ LOG_OpenFileLog(const char *log_file)
if (!f) if (!f)
LOG_FATAL("Could not open log file %s", log_file); LOG_FATAL("Could not open log file %s", log_file);
/* Enable line buffering */
setvbuf(f, NULL, _IOLBF, BUFSIZ);
file_log = f; file_log = f;
} }