mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-03 15:23:04 +00:00
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: Tycho Andersen <tycho.andersen@canonical.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
1d19f48807
commit
2fa8062e3c
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue