mirror of
https://github.com/checkpoint-restore/criu
synced 2025-09-01 23:05:39 +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:
4
cgroup.c
4
cgroup.c
@@ -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 */
|
/* 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);
|
ncd->path = xstrdup(fpath + path_pref_len);
|
||||||
|
|
||||||
if (!ncd->path) {
|
if (!ncd->path) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto out;
|
goto out;
|
||||||
|
Reference in New Issue
Block a user