From 81b5d48a34ef5d20a8795aa322002045cc20b5df Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Thu, 27 Jun 2019 14:27:58 +0200 Subject: [PATCH] cgroups: move variable into tighter scope Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index b0f90f222..f29ccd1bc 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -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]; -- 2.39.2