X-Git-Url: https://git.octo.it/?a=blobdiff_plain;ds=sidebyside;f=src%2Fuptime.c;h=43d72e53d35fe1f8bc411e01bcba15f68629d49a;hb=d486225f89ea52d8ed2b4242eba2ad94c409f837;hp=76eb0d50a865d4c247a347e4227dad675298a8e7;hpb=c92ee394cbd2aa96b6b300a3baff242fe3434c04;p=collectd.git diff --git a/src/uptime.c b/src/uptime.c index 76eb0d50..43d72e53 100644 --- a/src/uptime.c +++ b/src/uptime.c @@ -52,6 +52,7 @@ /* * Global variables */ + #if HAVE_KSTAT_H #include #endif @@ -90,9 +91,7 @@ static time_t uptime_get_sys(void) { /* {{{ */ status = sysinfo(&info); if (status != 0) { - char errbuf[1024]; - ERROR("uptime plugin: Error calling sysinfo: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("uptime plugin: Error calling sysinfo: %s", STRERRNO); return -1; } @@ -151,9 +150,7 @@ static time_t uptime_get_sys(void) { /* {{{ */ status = sysctl(mib, STATIC_ARRAY_SIZE(mib), &boottv, &boottv_len, /* new_value = */ NULL, /* new_length = */ 0); if (status != 0) { - char errbuf[1024]; - ERROR("uptime plugin: No value read from sysctl interface: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("uptime plugin: No value read from sysctl interface: %s", STRERRNO); return -1; } @@ -173,9 +170,7 @@ static time_t uptime_get_sys(void) { /* {{{ */ status = perfstat_cpu_total(NULL, &cputotal, sizeof(perfstat_cpu_total_t), 1); if (status < 0) { - char errbuf[1024]; - ERROR("uptime plugin: perfstat_cpu_total: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("uptime plugin: perfstat_cpu_total: %s", STRERRNO); return -1; }