When showing the status of the "-.slice" slice root unit (whose reported
cgroup path is ""), we suppressed the cgroup tree so far, because
skipped it for all unit with an empty cgroup path. Let's fix that, and
properly handle the empty cgroup path.
if (r < 0)
return bus_log_parse_error(r);
- if (!isempty(s)) {
+ if (streq(name, "ControlGroup"))
+ i->control_group = s;
+ else if (!isempty(s)) {
+ /* For all but the cgroup path (see above) we
+ * consider the empty string as unset. For the
+ * cgroup path the empty string refers to the
+ * root of the cgroup tree. */
+
if (streq(name, "Id"))
i->id = s;
else if (streq(name, "LoadState"))
i->control_group = e;
}
#endif
- else if (streq(name, "ControlGroup"))
- i->control_group = s;
else if (streq(name, "StatusText"))
i->status_text = s;
else if (streq(name, "PIDFile"))