diff options
Diffstat (limited to 'src/coredump/coredumpctl.c')
-rw-r--r-- | src/coredump/coredumpctl.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 3a3cd7dca2..8de86a7897 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -8,6 +8,7 @@ #include "sd-bus.h" #include "sd-journal.h" +#include "sd-json.h" #include "sd-messages.h" #include "alloc-util.h" @@ -26,6 +27,7 @@ #include "glob-util.h" #include "journal-internal.h" #include "journal-util.h" +#include "json-util.h" #include "log.h" #include "macro.h" #include "main-func.h" @@ -56,7 +58,7 @@ static const char *arg_directory = NULL; static char *arg_root = NULL; static char *arg_image = NULL; static char **arg_file = NULL; -static JsonFormatFlags arg_json_format_flags = JSON_FORMAT_OFF; +static sd_json_format_flags_t arg_json_format_flags = SD_JSON_FORMAT_OFF; static PagerFlags arg_pager_flags = 0; static int arg_legend = true; static size_t arg_rows_max = SIZE_MAX; @@ -804,26 +806,26 @@ static int print_info(FILE *file, sd_journal *j, bool need_space) { /* Print out the build-id of the 'main' ELF module, by matching the JSON key * with the 'exe' field. */ if (exe && pkgmeta_json) { - _cleanup_(json_variant_unrefp) JsonVariant *v = NULL; + _cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL; - r = json_parse(pkgmeta_json, 0, &v, NULL, NULL); + r = sd_json_parse(pkgmeta_json, 0, &v, NULL, NULL); if (r < 0) { _cleanup_free_ char *esc = cescape(pkgmeta_json); log_warning_errno(r, "json_parse on \"%s\" failed, ignoring: %m", strnull(esc)); } else { const char *module_name; - JsonVariant *module_json; + sd_json_variant *module_json; JSON_VARIANT_OBJECT_FOREACH(module_name, module_json, v) { - JsonVariant *build_id; + sd_json_variant *build_id; /* We only print the build-id for the 'main' ELF module */ if (!path_equal_filename(module_name, exe)) continue; - build_id = json_variant_by_key(module_json, "buildId"); + build_id = sd_json_variant_by_key(module_json, "buildId"); if (build_id) - fprintf(file, " build-id: %s\n", json_variant_string(build_id)); + fprintf(file, " build-id: %s\n", sd_json_variant_string(build_id)); break; } |