X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Flogfile.c;h=66922870c0c0682b8deaf85a3f95425bc5db07ff;hp=e5807f1b4ba5ab6b9a9828cd1929b4547a41dd89;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hpb=6026e3162e522b133d10596710527d24c2921b55 diff --git a/src/logfile.c b/src/logfile.c index e5807f1b..66922870 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -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; \