Merge pull request #34633 from keszybz/sd-json-enum-formatting

Add sd_json_format_enabled() helper
This commit is contained in:
Yu Watanabe
2024-10-29 03:29:03 +09:00
committed by GitHub
33 changed files with 108 additions and 100 deletions
+1 -1
View File
@@ -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++) {
+1 -1
View File
@@ -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)