Commit 45d029f0 authored by Pavel Emelyanov's avatar Pavel Emelyanov

cg: Keep "/" in cgroup root paths

The ftw trims tail "/" from path argument.
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
Acked-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
parent 586eb55f
......@@ -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 */
ncd->path = xstrdup(fpath + path_pref_len);
if (fpath[path_pref_len] == '\0')
ncd->path = xstrdup("/");
else
ncd->path = xstrdup(fpath + path_pref_len);
if (!ncd->path) {
ret = -1;
goto out;
......
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