summaryrefslogtreecommitdiffstats
path: root/src/cgls
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-02 02:26:58 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-02-02 02:29:09 +0100
commitd3e8277d5004163c725a895778c3a9dce9ca091e (patch)
tree720be3e42a17fa770a16a3e194d640cc335e692c /src/cgls
parentcgls: make function to query cgroup root public (diff)
downloadsystemd-d3e8277d5004163c725a895778c3a9dce9ca091e.tar.xz
systemd-d3e8277d5004163c725a895778c3a9dce9ca091e.zip
cgtop: use common function to query cgroup root
show_cgroup_get_root_and_warn is renamed to show_cgroup_get_path_and_warn because it now optionally allows querying a non-root path. This removes duplicated code and teaches cgtop to combine -M with a root prefix: $ systemd-cgtop -M myprecious /system.slice ...
Diffstat (limited to 'src/cgls')
-rw-r--r--src/cgls/cgls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
index e6ec9640a8..1d21c1c20c 100644
--- a/src/cgls/cgls.c
+++ b/src/cgls/cgls.c
@@ -154,7 +154,7 @@ int main(int argc, char *argv[]) {
_cleanup_free_ char *root = NULL;
int i;
- r = show_cgroup_get_root_and_warn(arg_machine, &root);
+ r = show_cgroup_get_path_and_warn(arg_machine, NULL, &root);
if (r < 0)
goto finish;
@@ -223,7 +223,7 @@ int main(int argc, char *argv[]) {
if (!done) {
_cleanup_free_ char *root = NULL;
- r = show_cgroup_get_root_and_warn(arg_machine, &root);
+ r = show_cgroup_get_path_and_warn(arg_machine, NULL, &root);
if (r < 0)
goto finish;