]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
Fix cgclear to continue unmounting on error
authorJan Safranek <jsafrane@redhat.com>
Fri, 4 Mar 2011 11:06:37 +0000 (12:06 +0100)
committerJan Safranek <jsafrane@redhat.com>
Mon, 7 Mar 2011 09:48:30 +0000 (10:48 +0100)
Currently when the cgclear stumbles upon a mount point which cannot be
removed it exits immediatelly. IMHO it should continue clearing the rest
and unmount as much as possible.

Signed-off-by: Jan Safranek <jsafrane@redhat.com>
Acked-by: Dhaval Giani <dhaval.giani@gmail.com>
src/config.c

index 23e1e430d419e58b7b1195da3c0c9c3eebbfbb22..0f71003f3755f59750d214b079e986191d3b2f1d 100644 (file)
@@ -780,8 +780,6 @@ int cgroup_unload_cgroups(void)
        }
 
        error = cgroup_get_controller_begin(&ctrl_handle, &info);
-
-
        if (error && error != ECGEOF) {
                ret = error;
                goto out_error;
@@ -796,10 +794,13 @@ int cgroup_unload_cgroups(void)
                        if (!curr_path)
                                goto out_errno;
 
-                       ret = cgroup_config_unload_controller(&info);
-
-                       if (ret)
-                               goto out_error;
+                       error = cgroup_config_unload_controller(&info);
+                       if (error) {
+                               /* remember the error and continue unloading
+                                * the rest */
+                               ret = error;
+                               error = 0;
+                       }
                }
 
                error = cgroup_get_controller_next(&ctrl_handle, &info);