summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2017-07-05 14:53:38 +0200
committerSven Eden <yamakuzure@gmx.net>2017-07-05 14:53:38 +0200
commit2a50d4724c0938a7a1af91556e0229263139ad54 (patch)
treefef442824150f52a249b5284646621261f505dd3
parent57189f74cbd92893ca907278caebd3d2878e0fea (diff)
Prep v232.2: cg_shift_path() : With other controllers, elogind might end up in name=foo:/elogind, where cgroup and root are both /elogind.
-rw-r--r--src/basic/cgroup-util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
index 2c7ceb71d..44ab535cc 100644
--- a/src/basic/cgroup-util.c
+++ b/src/basic/cgroup-util.c
@@ -1329,7 +1329,11 @@ int cg_shift_path(const char *cgroup, const char *root, const char **shifted) {
}
p = path_startswith(cgroup, root);
+#if 0 /// With other controllers, elogind might end up in /elogind, and *p is 0
if (p && p > cgroup)
+#else
+ if (p && p[0] && (p > cgroup))
+#endif // 0
*shifted = p - 1;
else
*shifted = cgroup;