Merge pull request #34633 from keszybz/sd-json-enum-formatting
Add sd_json_format_enabled() helper
This commit is contained in:
@@ -1936,7 +1936,7 @@ int show_boot_entries(const BootConfig *config, sd_json_format_flags_t json_form
|
||||
|
||||
assert(config);
|
||||
|
||||
if (!FLAGS_SET(json_format, SD_JSON_FORMAT_OFF)) {
|
||||
if (sd_json_format_enabled(json_format)) {
|
||||
_cleanup_(sd_json_variant_unrefp) sd_json_variant *array = NULL;
|
||||
|
||||
for (size_t i = 0; i < config->n_entries; i++) {
|
||||
|
||||
@@ -3124,7 +3124,7 @@ int table_print_json(Table *t, FILE *f, sd_json_format_flags_t flags) {
|
||||
|
||||
assert(t);
|
||||
|
||||
if (flags & SD_JSON_FORMAT_OFF) /* If JSON output is turned off, use regular output */
|
||||
if (!sd_json_format_enabled(flags)) /* If JSON output is turned off, use regular output */
|
||||
return table_print(t, f);
|
||||
|
||||
if (!f)
|
||||
|
||||
Reference in New Issue
Block a user