From: Sven Eden Date: Mon, 20 Feb 2017 07:26:32 +0000 (+0100) Subject: cg_shift_path(): Do not shift if cgroup and root are equal X-Git-Tag: v226.4~1^2~20 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=34b8612104beeb72bf7e1deec998b66dbded5c73;p=elogind.git cg_shift_path(): Do not shift if cgroup and root are equal --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 98a353ddb..f7a892380 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -1203,10 +1203,11 @@ int cg_shift_path(const char *cgroup, const char *root, const char **shifted) { return r; root = rt; + log_debug_elogind("Determined root path: \"%s\"", root); } p = path_startswith(cgroup, root); - if (p && p > cgroup) + if (p && p[0] && (p > cgroup)) *shifted = p - 1; else *shifted = cgroup;