]> 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:27:58 +0000 (14:27 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 27 Jun 2019 12:27:58 +0000 (14:27 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index b0f90f222971b4ed945ee282761b3174f33e43f6..f29ccd1bcc11a6c9ccc03585c75c9248da477073 100644 (file)
@@ -2086,7 +2086,7 @@ on_error:
 __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
                                         const char *lxcpath, pid_t pid)
 {
-       int i, len, ret;
+       int len, ret;
        char pidstr[INTTYPE_TO_STRLEN(pid_t)];
 
        if (!ops->hierarchies)
@@ -2096,7 +2096,7 @@ __cgfsng_ops static bool cgfsng_attach(struct cgroup_ops *ops, const char *name,
        if (len < 0 || (size_t)len >= sizeof(pidstr))
                return false;
 
-       for (i = 0; ops->hierarchies[i]; i++) {
+       for (int i = 0; ops->hierarchies[i]; i++) {
                __do_free char *fullpath = NULL, *path = NULL;
                struct hierarchy *h = ops->hierarchies[i];