]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgls: pretty print root cgroup path
authorLennart Poettering <lennart@poettering.net>
Mon, 31 Aug 2015 11:03:16 +0000 (13:03 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 31 Aug 2015 11:20:44 +0000 (13:20 +0200)
Make sure show it as "/" rather than empty string.

src/cgls/cgls.c

index 22f33f000ddf0c6e2236d30f52181301bcd79fa7..a8d910d5321eae516a8ee6a3e22e19ca15622c87 100644 (file)
@@ -263,7 +263,7 @@ int main(int argc, char *argv[]) {
                         if (r < 0)
                                 goto finish;
 
-                        printf("Control group %s:\n", root);
+                        printf("Control group %s:\n", isempty(root) ? "/" : root);
                         fflush(stdout);
 
                         r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, root, NULL, 0, arg_kernel_threads, output_flags);