diff --git a/src/logfile.c b/src/logfile.c
index ded7732b00ce22fcc648cbb8ae2207c53f26db94..0f20f3ca117d912b9df8b4d5118b93ee9660ead0 100644 (file)
--- a/src/logfile.c
+++ b/src/logfile.c
cdtime_t timestamp_time)
{
FILE *fh;
- int do_close = 0;
+ _Bool do_close = 0;
struct tm timestamp_tm;
char timestamp_str[64];
char level_str[16] = "";
else
fprintf (fh, "%s%s\n", level_str, msg);
- if (do_close != 0)
+ if (do_close) {
fclose (fh);
+ } else {
+ fflush(fh);
+ }
}
pthread_mutex_unlock (&file_lock);