From: Jan Safranek Date: Tue, 22 Dec 2009 08:24:04 +0000 (+0100) Subject: Make cgclear quiert when there is nothing to clear. X-Git-Tag: v0.35~8^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=054e8bb87a19d9a69d6c4ea509a8d2d4cb70aa01;p=thirdparty%2Flibcgroup.git 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 --- diff --git a/src/tools/cgclear.c b/src/tools/cgclear.c index 14857683..c2862728 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));