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:
parent
a1c7a1f057
commit
324d9acab7
@ -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");
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user