1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-26 10:03:40 +03:00

machinectl/loginctl: show json output if requested even if zero entries

This commit is contained in:
Lennart Poettering 2019-05-07 01:21:24 +02:00
parent a1c7a1f057
commit 324d9acab7
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ static int show_table(Table *table, const char *word) {
assert(table);
assert(word);
if (table_get_rows(table) > 1) {
if (table_get_rows(table) > 1 || OUTPUT_MODE_IS_JSON(arg_output)) {
r = table_set_sort(table, (size_t) 0, (size_t) -1);
if (r < 0)
return log_error_errno(r, "Failed to sort table: %m");

View File

@ -255,7 +255,7 @@ static int show_table(Table *table, const char *word) {
assert(table);
assert(word);
if (table_get_rows(table) > 1) {
if (table_get_rows(table) > 1 || OUTPUT_MODE_IS_JSON(arg_output)) {
r = table_set_sort(table, (size_t) 0, (size_t) -1);
if (r < 0)
return log_error_errno(r, "Failed to sort table: %m");