]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgmanager - fix (again) previous commit
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 13 Jan 2016 17:26:43 +0000 (09:26 -0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 13 Jan 2016 17:28:15 +0000 (09:28 -0800)
Bad late-night commit.  We were doing a while loop for a reason.  Just
initialize i to 0 before the while loop.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/cgmanager.c

index 4c3a200c76dbe285be734cd33e14480af8a03d6a..c973bacda3ee96b09e5cb77f63b8601381a1a729 100644 (file)
@@ -1284,7 +1284,7 @@ static char *get_last_controller_in_list(char *list)
  */
 static bool verify_final_subsystems(const char *cgroup_use)
 {
-       int i = 0;
+       int i;
        bool dropped_any = false;
        bool bret = false;
        const char *cgroup_pattern;
@@ -1305,7 +1305,8 @@ static bool verify_final_subsystems(const char *cgroup_use)
        if (!probe)
                goto out;
 
-       for (i = 0; i < nr_subsystems; i++) {
+       i = 0;
+       while (i < nr_subsystems) {
                char *p = get_last_controller_in_list(subsystems[i]);
 
                if (!subsys_is_writeable(p, probe)) {