X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcontextswitch.c;h=acf3a74d65711151151a469495e8ed90669d7e5c;hb=c4439c9cb3e2348ad7013644731de27a55eca478;hp=1d73f0417d0d125401def305d9bf76e8d6634511;hpb=96b920e6b7bf70560eb95c911202afbeaab2b965;p=collectd.git diff --git a/src/contextswitch.c b/src/contextswitch.c index 1d73f041..acf3a74d 100644 --- a/src/contextswitch.c +++ b/src/contextswitch.c @@ -23,8 +23,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #ifdef HAVE_SYS_SYSCTL_H #include @@ -69,7 +69,7 @@ static int cs_read(void) { if (status != 0) { ERROR("contextswitch plugin: sysctlbyname " "(vm.stats.sys.v_swtch) failed"); - return (-1); + return -1; } cs_submit(value); @@ -85,9 +85,8 @@ static int cs_read(void) { fh = fopen("/proc/stat", "r"); if (fh == NULL) { - ERROR("contextswitch plugin: unable to open /proc/stat: %s", - sstrerror(errno, buffer, sizeof(buffer))); - return (-1); + ERROR("contextswitch plugin: unable to open /proc/stat: %s", STRERRNO); + return -1; } while (fgets(buffer, sizeof(buffer), fh) != NULL) { @@ -126,10 +125,8 @@ static int cs_read(void) { status = perfstat_cpu_total(NULL, &perfcputotal, sizeof(perfstat_cpu_total_t), 1); if (status < 0) { - char errbuf[1024]; - ERROR("contextswitch plugin: perfstat_cpu_total: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + ERROR("contextswitch plugin: perfstat_cpu_total: %s", STRERRNO); + return -1; } cs_submit(perfcputotal.pswitch);