Skip to content

Commit

Permalink
cgroups: move variables into tighter scope
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Aug 11, 2019
1 parent 64b11bd commit bba1ede
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/lxc/cgroups/cgfsng.c
Expand Up @@ -2411,15 +2411,13 @@ __cgfsng_ops static bool cgfsng_setup_limits(struct cgroup_ops *ops,
static bool cgroup_use_wants_controllers(const struct cgroup_ops *ops,
char **controllers)
{
char **cur_ctrl, **cur_use;

if (!ops->cgroup_use)
return true;

for (cur_ctrl = controllers; cur_ctrl && *cur_ctrl; cur_ctrl++) {
for (char **cur_ctrl = controllers; cur_ctrl && *cur_ctrl; cur_ctrl++) {
bool found = false;

for (cur_use = ops->cgroup_use; cur_use && *cur_use; cur_use++) {
for (char **cur_use = ops->cgroup_use; cur_use && *cur_use; cur_use++) {
if (strcmp(*cur_use, *cur_ctrl) != 0)
continue;

Expand Down

0 comments on commit bba1ede

Please sign in to comment.