diff options
author | Lennart Poettering <lennart@poettering.net> | 2016-06-13 18:54:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-06-13 18:54:36 +0200 |
commit | 51e22f8851fae578188bd190510a205f0e4487f4 (patch) | |
tree | 45d2a186f02cf500949b725b900d9f806ca49a41 | |
parent | f256aa8853ad5d856457aa427224a585df54b00b (diff) |
systemctl: fix assertion hit when showing state of a unit without control group
-rw-r--r-- | src/systemctl/systemctl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 784c1cd7b5..74ef2d7ba1 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3847,14 +3847,13 @@ static void print_status_info( printf(" CPU: %s\n", format_timespan(buf, sizeof(buf), i->cpu_usage_nsec / NSEC_PER_USEC, USEC_PER_MSEC)); } - if (i->control_group) - printf(" CGroup: %s\n", i->control_group); - - { + if (i->control_group) { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; static const char prefix[] = " "; unsigned c; + printf(" CGroup: %s\n", i->control_group); + c = columns(); if (c > sizeof(prefix) - 1) c -= sizeof(prefix) - 1; |