X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcgroups.c;h=2584eff01edd2a71d1b7acc69f1ac02b400d49ec;hb=c76419c0cf983f1ecd3d36aa236cc4e3f9cff733;hp=508ba90f144ed5f65b4017361ab19815434ed04d;hpb=4103105fb43cd72294f165b2541540b3a8a99532;p=collectd.git diff --git a/src/cgroups.c b/src/cgroups.c index 508ba90f..2584eff0 100644 --- a/src/cgroups.c +++ b/src/cgroups.c @@ -25,7 +25,6 @@ #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_mount.h" #include "utils_ignorelist.h" @@ -47,7 +46,6 @@ static void cgroups_submit_one (char const *plugin_instance, vl.values = &value; vl.values_len = 1; - sstrncpy (vl.host, hostname_g, sizeof (vl.host)); sstrncpy (vl.plugin, "cgroups", sizeof (vl.plugin)); sstrncpy (vl.plugin_instance, plugin_instance, sizeof (vl.plugin_instance)); @@ -207,18 +205,16 @@ static int cgroups_config (const char *key, const char *value) static int cgroups_read (void) { - cu_mount_t *mnt_list; - cu_mount_t *mnt_ptr; + cu_mount_t *mnt_list = NULL; _Bool cgroup_found = 0; - mnt_list = NULL; if (cu_mount_getlist (&mnt_list) == NULL) { ERROR ("cgroups plugin: cu_mount_getlist failed."); return (-1); } - for (mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) + for (cu_mount_t *mnt_ptr = mnt_list; mnt_ptr != NULL; mnt_ptr = mnt_ptr->next) { /* Find the cgroup mountpoint which contains the cpuacct * controller. */