From: Serge Hallyn Date: Wed, 13 Jan 2016 17:26:43 +0000 (-0800) Subject: cgmanager - fix (again) previous commit X-Git-Tag: lxc-2.0.0.beta2~63 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f4aafaccbd7b94b8c8afe4be8b9dd132fdc9c34;p=thirdparty%2Flxc.git cgmanager - fix (again) previous commit 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 --- diff --git a/src/lxc/cgmanager.c b/src/lxc/cgmanager.c index 4c3a200c7..c973bacda 100644 --- a/src/lxc/cgmanager.c +++ b/src/lxc/cgmanager.c @@ -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)) {