summaryrefslogtreecommitdiff
path: root/src/cgtop
diff options
context:
space:
mode:
authorShawn Landden <shawnlandden@gmail.com>2012-05-21 22:54:41 -0700
committerLennart Poettering <lennart@poettering.net>2012-05-29 21:59:10 +0200
commit63210a15e1efdbda3fb3abd9a6ae9961fd0ea153 (patch)
tree4fe062231ddf90e131d563403ec107c5e2f6eb62 /src/cgtop
parent80d37ae7b9d2c471e89e018a8f1e7cab8cd53123 (diff)
cgtop: work even if not all cgroups are available
cgtop quits on startup if all the cgroup mounts it expects are not available. Just continue without nonexistant ones.
Diffstat (limited to 'src/cgtop')
-rw-r--r--src/cgtop/cgtop.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/cgtop/cgtop.c b/src/cgtop/cgtop.c
index ddb57094b1..f988adb363 100644
--- a/src/cgtop/cgtop.c
+++ b/src/cgtop/cgtop.c
@@ -341,17 +341,22 @@ static int refresh(Hashmap *a, Hashmap *b, unsigned iteration) {
r = refresh_one("name=systemd", "/", a, b, iteration, 0);
if (r < 0)
- return r;
-
+ if (r != -ENOENT)
+ return r;
r = refresh_one("cpuacct", "/", a, b, iteration, 0);
if (r < 0)
- return r;
-
+ if (r != -ENOENT)
+ return r;
r = refresh_one("memory", "/", a, b, iteration, 0);
if (r < 0)
- return r;
+ if (r != -ENOENT)
+ return r;
- return refresh_one("blkio", "/", a, b, iteration, 0);
+ r = refresh_one("blkio", "/", a, b, iteration, 0);
+ if (r < 0)
+ if (r != -ENOENT)
+ return r;
+ return 0;
}
static int group_compare(const void*a, const void *b) {