X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flogfile.c;h=ee2ed5cef1ee3f99b72906d9161972cfa3235fe7;hb=6e41c3b1f024d7944e5e8010a87933555c662474;hp=de9b1f75b19512632ef7a9649470fca5ac637620;hpb=85d892df2794d992c8e3554d8990d1306f114c11;p=collectd.git diff --git a/src/logfile.c b/src/logfile.c index de9b1f75..ee2ed5ce 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -77,7 +77,7 @@ static int logfile_config(const char *key, const char *value) { static void logfile_print(const char *msg, int severity, cdtime_t timestamp_time) { FILE *fh; - _Bool do_close = 0; + bool do_close = false; char timestamp_str[64]; char level_str[16] = ""; @@ -122,13 +122,12 @@ static void logfile_print(const char *msg, int severity, fh = stdout; else { fh = fopen(log_file, "a"); - do_close = 1; + do_close = true; } if (fh == NULL) { - char errbuf[1024]; fprintf(stderr, "logfile plugin: fopen (%s) failed: %s\n", log_file, - sstrerror(errno, errbuf, sizeof(errbuf))); + STRERRNO); } else { if (print_timestamp) fprintf(fh, "[%s] %s%s\n", timestamp_str, level_str, msg);