Commit 2fa8062e authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

cgroup: update cgns prefix *after* using it

We're using the old cgns prefix length in allocating dirnew, so let's not
update it before that.

travis-ci: success for cgroup: update cgns prefix *after* using it
Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 1d19f488
......@@ -1712,7 +1712,6 @@ static int rewrite_cgsets(CgroupEntry *cge, char **controllers, int n_controller
return -ENOMEM;
}
xfree(prev);
cg->cgns_prefix = strlen(newroot);
if (!dirnew) {
/* -1 because cgns_prefix includes leading "/" */
......@@ -1720,6 +1719,7 @@ static int rewrite_cgsets(CgroupEntry *cge, char **controllers, int n_controller
if (!dirnew)
return -ENOMEM;
}
cg->cgns_prefix = strlen(newroot);
} else {
char *prev = cg->path;
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment