summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-03-15 18:43:47 +0100
committerLennart Poettering <lennart@poettering.net>2011-03-15 18:43:47 +0100
commitb9a8e638ed520bc9b528a1e8539ca4b9026861b4 (patch)
tree546962ceaf53a642f55ba251b210c2398524fe4a
parentf3accc08d36c3937f6bc2e696679610dd36fbfaf (diff)
cgls: don't strip user processes and kernel threads from default output
-rw-r--r--src/cgls.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cgls.c b/src/cgls.c
index 6f083015ed..2bde743acf 100644
--- a/src/cgls.c
+++ b/src/cgls.c
@@ -112,8 +112,12 @@ int main(int argc, char *argv[]) {
if ((r = cg_get_by_pid(SYSTEMD_CGROUP_CONTROLLER, 1, &root)) < 0)
t = "/";
- else
- t = root;
+ else {
+ if (endswith(root, "/system"))
+ root[strlen(root)-7] = 0;
+
+ t = root[0] ? root : "/";
+ }
r = show_cgroup(SYSTEMD_CGROUP_CONTROLLER, t, NULL, 0);
free(root);