summaryrefslogtreecommitdiffstats
path: root/src/shared/cgroup-show.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-12-23 11:56:13 +0100
committerLennart Poettering <lennart@poettering.net>2012-12-24 00:29:39 +0100
commitb08121d00467874ac9aa0dc6f59787877f1bb427 (patch)
tree02ec43591a75af54925396411ada914dabe01e22 /src/shared/cgroup-show.c
parentbuild-sys: Make libsystemd-shared link to libsystemd-daemon (diff)
downloadsystemd-b08121d00467874ac9aa0dc6f59787877f1bb427.tar.xz
systemd-b08121d00467874ac9aa0dc6f59787877f1bb427.zip
systemctl: don't show cgroup field for a unit if cgroup is empty
Diffstat (limited to 'src/shared/cgroup-show.c')
-rw-r--r--src/shared/cgroup-show.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 437d09711b..2b79f370f9 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -335,7 +335,7 @@ int show_cgroup_and_extra(const char *controller, const char *path, const char *
int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, unsigned n_columns, bool kernel_threads, bool all, const pid_t extra_pids[], unsigned n_extra_pids) {
int r;
- char *controller, *path;
+ _cleanup_free_ char *controller = NULL, *path = NULL;
assert(spec);
@@ -343,9 +343,5 @@ int show_cgroup_and_extra_by_spec(const char *spec, const char *prefix, unsigned
if (r < 0)
return r;
- r = show_cgroup_and_extra(controller, path, prefix, n_columns, kernel_threads, all, extra_pids, n_extra_pids);
- free(controller);
- free(path);
-
- return r;
+ return show_cgroup_and_extra(controller, path, prefix, n_columns, kernel_threads, all, extra_pids, n_extra_pids);
}