2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

cg: Keep "/" in cgroup root paths

The ftw trims tail "/" from path argument.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Tycho Andersen <tycho.andersen@canonical.com>
This commit is contained in:
Pavel Emelyanov
2014-07-16 19:49:28 +04:00
parent 586eb55f35
commit 45d029f04e

View File

@@ -244,7 +244,11 @@ static int add_cgroup(const char *fpath, const struct stat *sb, int typeflag)
}
/* chop off the first "/proc/self/fd/N" str */
if (fpath[path_pref_len] == '\0')
ncd->path = xstrdup("/");
else
ncd->path = xstrdup(fpath + path_pref_len);
if (!ncd->path) {
ret = -1;
goto out;