From 53c6f2fd9c7c6d66d9d316544439f9dbd0952d1d Mon Sep 17 00:00:00 2001 From: Shawn Landden Date: Mon, 21 May 2012 22:54:41 -0700 Subject: [PATCH] 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. --- src/cgtop.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/cgtop.c b/src/cgtop.c index 8b8617dc1..1257fd20c 100644 --- a/src/cgtop.c +++ b/src/cgtop.c @@ -340,17 +340,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) {