]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Make cgclear quiert when there is nothing to clear.
authorJan Safranek <jsafrane@redhat.com>
Tue, 22 Dec 2009 08:24:04 +0000 (09:24 +0100)
committerJan Safranek <jsafrane@redhat.com>
Tue, 22 Dec 2009 08:24:04 +0000 (09:24 +0100)
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>
src/tools/cgclear.c

index 148576839b40f8681c4ac63ffa56e92a04200b65..c2862728510057ca227f0a95c5ddf8c7f0e2c4cf 100644 (file)
@@ -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));