projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
write_riemann: send notification message to riemann via description field
[collectd.git]
/
src
/
logfile.c
diff --git
a/src/logfile.c
b/src/logfile.c
index
ded7732
..
0f20f3c
100644
(file)
--- a/
src/logfile.c
+++ b/
src/logfile.c
@@
-81,7
+81,7
@@
static void logfile_print (const char *msg, int severity,
cdtime_t timestamp_time)
{
FILE *fh;
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] = "";
struct tm timestamp_tm;
char timestamp_str[64];
char level_str[16] = "";
@@
-151,8
+151,11
@@
static void logfile_print (const char *msg, int severity,
else
fprintf (fh, "%s%s\n", level_str, msg);
else
fprintf (fh, "%s%s\n", level_str, msg);
- if (do_close
!= 0)
+ if (do_close
) {
fclose (fh);
fclose (fh);
+ } else {
+ fflush(fh);
+ }
}
pthread_mutex_unlock (&file_lock);
}
pthread_mutex_unlock (&file_lock);