X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fpf.c;h=1e4c465b1fe658cffb5e6dbf41982679acc31c2e;hp=533dffedeeb83e620f5334aec4c2e402484dd400;hb=a9e50e9e30ecde17e167e271060c8183bfcbf407;hpb=11c8a760c2d354b2f4637bdb297efb253bfaa519 diff --git a/src/pf.c b/src/pf.c index 533dffed..1e4c465b 100644 --- a/src/pf.c +++ b/src/pf.c @@ -83,26 +83,22 @@ static int pf_read(void) { fd = open(pf_device, O_RDONLY); if (fd < 0) { - char errbuf[1024]; - ERROR("pf plugin: Unable to open %s: %s", pf_device, - sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + ERROR("pf plugin: Unable to open %s: %s", pf_device, STRERRNO); + return -1; } status = ioctl(fd, DIOCGETSTATUS, &state); if (status != 0) { - char errbuf[1024]; - ERROR("pf plugin: ioctl(DIOCGETSTATUS) failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("pf plugin: ioctl(DIOCGETSTATUS) failed: %s", STRERRNO); close(fd); - return (-1); + return -1; } close(fd); if (!state.running) { WARNING("pf plugin: PF is not running."); - return (-1); + return -1; } for (int i = 0; i < PFRES_MAX; i++) @@ -121,7 +117,7 @@ static int pf_read(void) { pf_submit("pf_states", "current", (uint32_t)state.states, /* is gauge = */ 1); - return (0); + return 0; } /* int pf_read */ void module_register(void) { plugin_register_read("pf", pf_read); }