X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fcgroups.c;h=8925239848f0ba2af42d50e92b6a5224fc050540;hp=4f34b3a9a7751084c4fcee15b4e9046889b8eeed;hb=48efd3deb4c9139fd060ff3d289896e9031bcc7c;hpb=7ef225022164d12f4560d03789c9d418b442d4cf diff --git a/src/cgroups.c b/src/cgroups.c index 4f34b3a9..89252398 100644 --- a/src/cgroups.c +++ b/src/cgroups.c @@ -23,15 +23,15 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" -#include "utils_ignorelist.h" -#include "utils_mount.h" +#include "utils/common/common.h" +#include "utils/ignorelist/ignorelist.h" +#include "utils/mount/mount.h" static char const *config_keys[] = {"CGroup", "IgnoreSelected"}; static int config_keys_num = STATIC_ARRAY_SIZE(config_keys); -static ignorelist_t *il_cgroup = NULL; +static ignorelist_t *il_cgroup; __attribute__((nonnull(1))) __attribute__((nonnull(2))) static void cgroups_submit_one(char const *plugin_instance, char const *type_instance, @@ -112,7 +112,7 @@ static int read_cpuacct_procs(const char *dirname, char const *cgroup_name, /* Strip colon off the first column, if found */ if (key[key_len - 1] == ':') - key[key_len - 1] = 0; + key[key_len - 1] = '\0'; status = parse_value(fields[1], &value, DS_TYPE_DERIVE); if (status != 0) @@ -181,7 +181,7 @@ static int cgroups_config(const char *key, const char *value) { static int cgroups_read(void) { cu_mount_t *mnt_list = NULL; - _Bool cgroup_found = 0; + bool cgroup_found = false; if (cu_mount_getlist(&mnt_list) == NULL) { ERROR("cgroups plugin: cu_mount_getlist failed."); @@ -199,7 +199,7 @@ static int cgroups_read(void) { walk_directory(mnt_ptr->dir, read_cpuacct_root, /* user_data = */ NULL, /* include_hidden = */ 0); - cgroup_found = 1; + cgroup_found = true; /* It doesn't make sense to check other cpuacct mount-points * (if any), they contain the same data. */ break;