summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/cgroup.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index 3d5d8898b6..d6156c3924 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -295,6 +295,9 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
/* Some cgroup attributes are not support on the root cgroup,
* hence silently ignore */
is_root = isempty(path) || path_equal(path, "/");
+ if (is_root)
+ /* Make sure we don't try to display messages with an empty path. */
+ path = "/";
/* We generally ignore errors caused by read-only mounted
* cgroup trees (assuming we are running in a container then),