chiark / gitweb /
cg_shift_path(): Do not shift if cgroup and root are equal
authorSven Eden <yamakuzure@gmx.net>
Mon, 20 Feb 2017 07:26:32 +0000 (08:26 +0100)
committerSven Eden <yamakuzure@gmx.net>
Tue, 14 Mar 2017 09:23:13 +0000 (10:23 +0100)
src/basic/cgroup-util.c

index 98a353d..f7a8923 100644 (file)
@@ -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;