X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fvmem.c;h=a4112bbbad1d1d3f3a09eeede81b45cbea85b46b;hp=cd9e7d2847ee14ed0e3b8a09e7bef89427f30c9e;hb=a59c14adfa86c823efff87ca797c4d6e6ce32913;hpb=01761867ced7bc5fe71546baf350be4a3e800600 diff --git a/src/vmem.c b/src/vmem.c index cd9e7d28..a4112bbb 100644 --- a/src/vmem.c +++ b/src/vmem.c @@ -26,14 +26,14 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #if KERNEL_LINUX static const char *config_keys[] = {"Verbose"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static int verbose_output = 0; +static int verbose_output; /* #endif KERNEL_LINUX */ #else @@ -60,7 +60,8 @@ static void submit(const char *plugin_instance, const char *type, static void submit_two(const char *plugin_instance, const char *type, const char *type_instance, derive_t c0, derive_t c1) { value_t values[] = { - {.derive = c0}, {.derive = c1}, + {.derive = c0}, + {.derive = c1}, }; submit(plugin_instance, type, type_instance, values, @@ -79,10 +80,10 @@ static int vmem_config(const char *key, const char *value) { else verbose_output = 0; } else { - return (-1); + return -1; } - return (0); + return 0; } /* int vmem_config */ static int vmem_read(void) { @@ -104,10 +105,8 @@ static int vmem_read(void) { fh = fopen("/proc/vmstat", "r"); if (fh == NULL) { - char errbuf[1024]; - ERROR("vmem plugin: fopen (/proc/vmstat) failed: %s", - sstrerror(errno, errbuf, sizeof(errbuf))); - return (-1); + ERROR("vmem plugin: fopen (/proc/vmstat) failed: %s", STRERRNO); + return -1; } while (fgets(buffer, sizeof(buffer), fh) != NULL) { @@ -253,12 +252,10 @@ static int vmem_read(void) { submit_two(NULL, "vmpage_io", "swap", pswpin, pswpout); #endif /* KERNEL_LINUX */ - return (0); + return 0; } /* int vmem_read */ void module_register(void) { plugin_register_config("vmem", vmem_config, config_keys, config_keys_num); plugin_register_read("vmem", vmem_read); } /* void module_register */ - -/* vim: set sw=2 sts=2 ts=8 : */