summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 55f5dbb)
raw | patch | inline | side by side (parent: 55f5dbb)
author | Florian Forster <octo@collectd.org> | |
Thu, 18 Apr 2013 10:12:40 +0000 (12:12 +0200) | ||
committer | Florian Forster <octo@collectd.org> | |
Thu, 18 Apr 2013 10:12:40 +0000 (12:12 +0200) |
The rest of the file is indented using tabs.
src/cgroups_cpuacct.c | patch | blob | history |
diff --git a/src/cgroups_cpuacct.c b/src/cgroups_cpuacct.c
index 7f285d6c257360faa7a4f2138506a6fddb35a414..3e3c054468add03250ae3c30a06ec78b16bae206 100644 (file)
--- a/src/cgroups_cpuacct.c
+++ b/src/cgroups_cpuacct.c
#include "utils_mount.h"
#include "utils_ignorelist.h"
-static const char *config_keys[] =
+static char const *config_keys[] =
{
"CGroup",
"IgnoreSelected"
* Gets called for every file/folder in /sys/fs/cgroup/cpu,cpuacct (or
* whereever cpuacct is mounted on the system). Calls walk_directory with the
* read_cpuacct_procs callback on every folder it finds, such as "system".
- *
*/
static int read_cpuacct_root (const char *dirname, const char *filename,
- void *user_data)
+ void *user_data)
{
- char abs_path[PATH_MAX];
- struct stat statbuf;
- int status;
-
- ssnprintf (abs_path, sizeof (abs_path), "%s/%s", dirname, filename);
-
- status = lstat (abs_path, &statbuf);
- if (status != 0)
- {
- ERROR ("cgroups_cpuacct plugin: stat (%s) failed.", abs_path);
- return (-1);
- }
-
- if (S_ISDIR (statbuf.st_mode))
- {
- status = walk_directory (abs_path, read_cpuacct_procs,
- /* user_data = */ NULL,
- /* include_hidden = */ 0);
- return (status);
- }
-
- return (0);
+ char abs_path[PATH_MAX];
+ struct stat statbuf;
+ int status;
+
+ ssnprintf (abs_path, sizeof (abs_path), "%s/%s", dirname, filename);
+
+ status = lstat (abs_path, &statbuf);
+ if (status != 0)
+ {
+ ERROR ("cgroups_cpuacct plugin: stat (%s) failed.", abs_path);
+ return (-1);
+ }
+
+ if (S_ISDIR (statbuf.st_mode))
+ {
+ status = walk_directory (abs_path, read_cpuacct_procs,
+ /* user_data = */ NULL,
+ /* include_hidden = */ 0);
+ return (status);
+ }
+
+ return (0);
}
static int cgroups_init (void)