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 <[email protected]>
---

 src/tools/cgclear.c |    3 +++
 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));


------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to