Commit 6ca5ac75 authored by Pavel Emelyanov's avatar Pavel Emelyanov

cg: Merge two equal if-s into one

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
parent 45d029f0
......@@ -296,21 +296,19 @@ static int collect_cgroups(struct list_head *ctls)
char *name, prefix[] = ".criu.cgmounts.XXXXXX";
struct cg_controller *cg;
if (strstartswith(cc->name, "name="))
if (strstartswith(cc->name, "name=")) {
name = cc->name + 5;
else
sprintf(opts, "none,%s", cc->name);
} else {
name = cc->name;
sprintf(opts, "%s", name);
}
if (mkdtemp(prefix) == NULL) {
pr_perror("can't make dir for cg mounts\n");
return -1;
}
if (name == cc->name)
sprintf(opts, "%s", name);
else
sprintf(opts, "none,%s", cc->name);
if (mount("none", prefix, "cgroup", 0, opts) < 0) {
pr_perror("couldn't mount %s\n", opts);
rmdir(prefix);
......
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