]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgmanager: fix abuse of 'i'
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 13 Jan 2016 01:21:59 +0000 (17:21 -0800)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Wed, 13 Jan 2016 01:21:59 +0000 (17:21 -0800)
we were initializing i to 0, then doing a while i <, but then a
separate commit (by myself) used i as a generic variable in between
those two.

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

index 559628574d6fed79a7e91b337f83c8a3a895b1a9..4c3a200c76dbe285be734cd33e14480af8a03d6a 100644 (file)
@@ -1286,7 +1286,7 @@ static bool verify_final_subsystems(const char *cgroup_use)
 {
        int i = 0;
        bool dropped_any = false;
-       bool ret = false;
+       bool bret = false;
        const char *cgroup_pattern;
        char tmpnam[50], *probe;
 
@@ -1305,7 +1305,7 @@ static bool verify_final_subsystems(const char *cgroup_use)
        if (!probe)
                goto out;
 
-       while (i < nr_subsystems) {
+       for (i = 0; i < nr_subsystems; i++) {
                char *p = get_last_controller_in_list(subsystems[i]);
 
                if (!subsys_is_writeable(p, probe)) {
@@ -1331,12 +1331,12 @@ static bool verify_final_subsystems(const char *cgroup_use)
 
        if (dropped_any)
                cgm_all_controllers_same = false;
-       ret = true;
+       bret = true;
 
 out:
        free(probe);
        cgm_dbus_disconnect();
-       return ret;
+       return bret;
 }
 
 static bool collect_subsytems(void)