summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Safranek <jsafrane@redhat.com>2009-12-22 09:24:04 +0100
committerJan Safranek <jsafrane@redhat.com>2009-12-22 09:24:04 +0100
commit054e8bb87a19d9a69d6c4ea509a8d2d4cb70aa01 (patch)
treee660cd14e4960b40450447076418593de794ef59
parenta75d6e2f87022d4ad6e0d1a50a06cfdee435e813 (diff)
downloadlibcg-054e8bb87a19d9a69d6c4ea509a8d2d4cb70aa01.tar.gz
libcg-054e8bb87a19d9a69d6c4ea509a8d2d4cb70aa01.tar.xz
libcg-054e8bb87a19d9a69d6c4ea509a8d2d4cb70aa01.zip
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 <jsafrane@redhat.com>
-rw-r--r--src/tools/cgclear.c3
1 files changed, 3 insertions, 0 deletions
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));