X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fpf.c;h=82adc53b275d2b10f0a194e586d220121f9fe4a5;hp=9dd5f93998de35f68f92ce5ee607406af1dbb905;hb=da11ce02eb202b3e01d3e2d1b40f248a84430973;hpb=79963d13c1884d1d92667cc502ad20758b084a12 diff --git a/src/pf.c b/src/pf.c index 9dd5f939..82adc53b 100644 --- a/src/pf.c +++ b/src/pf.c @@ -69,7 +69,6 @@ static void pf_submit(char const *type, char const *type_instance, uint64_t val, vl.values = values; vl.values_len = 1; - sstrncpy(vl.host, hostname_g, sizeof(vl.host)); sstrncpy(vl.plugin, "pf", sizeof(vl.plugin)); sstrncpy(vl.type, type, sizeof(vl.type)); sstrncpy(vl.type_instance, type_instance, sizeof(vl.type_instance)); @@ -87,7 +86,7 @@ static int pf_read(void) { char errbuf[1024]; ERROR("pf plugin: Unable to open %s: %s", pf_device, sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + return -1; } status = ioctl(fd, DIOCGETSTATUS, &state); @@ -96,14 +95,14 @@ static int pf_read(void) { ERROR("pf plugin: ioctl(DIOCGETSTATUS) failed: %s", sstrerror(errno, errbuf, sizeof(errbuf))); 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++) @@ -122,7 +121,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); }