From 2fa8062e3c79834f03e676dd6a4e0e7ef951408c Mon Sep 17 00:00:00 2001 From: Tycho Andersen Date: Mon, 31 Oct 2016 22:07:00 +0300 Subject: [PATCH] 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 Signed-off-by: Pavel Emelyanov --- criu/cgroup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/criu/cgroup.c b/criu/cgroup.c index caa8033fb..5f8e84e13 100644 --- a/criu/cgroup.c +++ b/criu/cgroup.c @@ -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; /*