X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flogfile.c;h=3917aa8f6d4df7329b297da6719bca7c62508a13;hb=61a4ed99b1a5b6d371bb745933d0efc5dff9505c;hp=e5807f1b4ba5ab6b9a9828cd1929b4547a41dd89;hpb=867ad628dc6fcd05bd584b605d7093cfc00c3d07;p=collectd.git diff --git a/src/logfile.c b/src/logfile.c index e5807f1b..3917aa8f 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 = 0; char timestamp_str[64]; char level_str[16] = ""; @@ -126,9 +126,8 @@ static void logfile_print(const char *msg, int severity, } 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); @@ -163,7 +162,7 @@ static int logfile_notification(const notification_t *n, int buf_len = sizeof(buf); int status; - status = ssnprintf( + status = snprintf( buf_ptr, buf_len, "Notification: severity = %s", (n->severity == NOTIF_FAILURE) ? "FAILURE" @@ -177,7 +176,7 @@ static int logfile_notification(const notification_t *n, #define APPEND(bufptr, buflen, key, value) \ if ((buflen > 0) && (strlen(value) > 0)) { \ - status = ssnprintf(bufptr, buflen, ", %s = %s", key, value); \ + status = snprintf(bufptr, buflen, ", %s = %s", key, value); \ if (status > 0) { \ bufptr += status; \ buflen -= status; \