X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fcgroups.c;h=f7c7e0d6345676ab77c79d8c6f0a880331b75273;hb=4d370741101aeb037ae52f3529a4a0869e0dc08a;hp=6d419722b7ef385ea0b8607f2b5b5056c849a408;hpb=a09f2fdf0450eb76317e1b7575a12ffb926068f4;p=collectd.git diff --git a/src/cgroups.c b/src/cgroups.c index 6d419722..f7c7e0d6 100644 --- a/src/cgroups.c +++ b/src/cgroups.c @@ -22,9 +22,9 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_mount.h" #include "utils_ignorelist.h" @@ -206,18 +206,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. */