]> git.proxmox.com Git - mirror_lxc.git/commitdiff
cgroups: move variable into tighter scope
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 27 Jun 2019 12:45:36 +0000 (14:45 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 27 Jun 2019 14:08:21 +0000 (16:08 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index 4205298b569058b9562f2963a9da227c4ab6cc24..78ab8e7e63028a3d36e5feeae5975fbb7a109769 100644 (file)
@@ -1765,7 +1765,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
                                        const char *root, int type)
 {
        __do_free char *tmpfspath = NULL;
-       int i, ret;
+       int ret;
        bool has_cgns = false, retval = false, wants_force_mount = false;
 
        if (!ops->hierarchies)
@@ -1803,7 +1803,7 @@ __cgfsng_ops static bool cgfsng_mount(struct cgroup_ops *ops,
        if (ret < 0)
                goto on_error;
 
-       for (i = 0; ops->hierarchies[i]; i++) {
+       for (int i = 0; ops->hierarchies[i]; i++) {
                __do_free char *controllerpath = NULL, *path2 = NULL;
                struct hierarchy *h = ops->hierarchies[i];
                char *controller = strrchr(h->mountpoint, '/');