summaryrefslogtreecommitdiffstats
path: root/src/machine/machinectl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/machine/machinectl.c')
-rw-r--r--src/machine/machinectl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 3eadb5f4e7..aa81cf071f 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -235,7 +235,7 @@ static int show_table(Table *table, const char *word) {
assert(table);
assert(word);
- if (table_get_rows(table) > 1 || OUTPUT_MODE_IS_JSON(arg_output)) {
+ if (!table_isempty(table) || OUTPUT_MODE_IS_JSON(arg_output)) {
r = table_set_sort(table, (size_t) 0);
if (r < 0)
return table_log_sort_error(r);
@@ -251,10 +251,10 @@ static int show_table(Table *table, const char *word) {
}
if (arg_legend) {
- if (table_get_rows(table) > 1)
- printf("\n%zu %s listed.\n", table_get_rows(table) - 1, word);
- else
+ if (table_isempty(table))
printf("No %s.\n", word);
+ else
+ printf("\n%zu %s listed.\n", table_get_rows(table) - 1, word);
}
return 0;