X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fcgroups.c;h=5830c7ba281e5ba955361c9a6bfe9051aafa43cf;hb=6e41c3b1f024d7944e5e8010a87933555c662474;hp=18e489d044262862233100f68fc8fe20a46e657c;hpb=e746ad785774de37a30302fef65f1c4aaf8698ab;p=collectd.git diff --git a/src/cgroups.c b/src/cgroups.c index 18e489d0..5830c7ba 100644 --- a/src/cgroups.c +++ b/src/cgroups.c @@ -79,9 +79,7 @@ static int read_cpuacct_procs(const char *dirname, char const *cgroup_name, cgroup_name); fh = fopen(abs_path, "r"); if (fh == NULL) { - char errbuf[1024]; - ERROR("cgroups plugin: fopen (\"%s\") failed: %s", abs_path, - sstrerror(errno, errbuf, sizeof(errbuf))); + ERROR("cgroups plugin: fopen (\"%s\") failed: %s", abs_path, STRERRNO); return -1; } @@ -183,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."); @@ -201,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;