From 054e8bb87a19d9a69d6c4ea509a8d2d4cb70aa01 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 22 Dec 2009 09:24:04 +0100 Subject: Make cgclear quiert when there is nothing to clear. Cgclear clears and unmounts all controllers. Therefore I think it's not an error when there is nothing to clear and unmount. Signed-off-by: Jan Safranek --- src/tools/cgclear.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tools/cgclear.c b/src/tools/cgclear.c index 1485768..c286272 100644 --- a/src/tools/cgclear.c +++ b/src/tools/cgclear.c @@ -27,6 +27,9 @@ int main(int argc, char *argv[]) int error; error = cgroup_unload_cgroups(); + /* Don't spit an error when there is nothing to clear. */ + if (error == ECGROUPNOTMOUNTED) + error = 0; if (error) { printf("%s failed with %s\n", argv[0], cgroup_strerror(error)); -- cgit