X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fping.c;h=1ffd72b7efbcdadea2d6d490faf7c9c87ecc97df;hp=8cefeed4e52e30afa936ea4e709033b0fd02f57c;hb=77ca1a45bab2f6adf9301723d0db68e5813a6d98;hpb=85d892df2794d992c8e3554d8990d1306f114c11 diff --git a/src/ping.c b/src/ping.c index 8cefeed4..1ffd72b7 100644 --- a/src/ping.c +++ b/src/ping.c @@ -294,9 +294,7 @@ static void *ping_thread(void *arg) /* {{{ */ _Bool send_successful = 0; if (gettimeofday(&tv_begin, NULL) < 0) { - char errbuf[1024]; - ERROR("ping plugin: gettimeofday failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("ping plugin: gettimeofday failed: %s", STRERRNO); ping_thread_error = 1; break; } @@ -321,9 +319,7 @@ static void *ping_thread(void *arg) /* {{{ */ (void)ping_dispatch_all(pingobj); if (gettimeofday(&tv_end, NULL) < 0) { - char errbuf[1024]; - ERROR("ping plugin: gettimeofday failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("ping plugin: gettimeofday failed: %s", STRERRNO); ping_thread_error = 1; break; } @@ -434,9 +430,8 @@ static int config_set_string(const char *name, /* {{{ */ tmp = strdup(value); if (tmp == NULL) { - char errbuf[1024]; ERROR("ping plugin: Setting `%s' to `%s' failed: strdup failed: %s", name, - value, sstrerror(errno, errbuf, sizeof(errbuf))); + value, STRERRNO); return 1; } @@ -454,18 +449,14 @@ static int ping_config(const char *key, const char *value) /* {{{ */ hl = malloc(sizeof(*hl)); if (hl == NULL) { - char errbuf[1024]; - ERROR("ping plugin: malloc failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("ping plugin: malloc failed: %s", STRERRNO); return 1; } host = strdup(value); if (host == NULL) { - char errbuf[1024]; sfree(hl); - ERROR("ping plugin: strdup failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("ping plugin: strdup failed: %s", STRERRNO); return 1; } @@ -530,7 +521,7 @@ static int ping_config(const char *key, const char *value) /* {{{ */ } /* }}} for (i = 0; i < size; i++) */ ping_data[size] = 0; } else - WARNING("ping plugin: Ignoring invalid Size %zu.", size); + WARNING("ping plugin: Ignoring invalid Size %" PRIsz ".", size); } else if (strcasecmp(key, "Timeout") == 0) { double tmp;