From: Yu Watanabe Date: Tue, 15 Apr 2025 20:38:13 +0000 (+0900) Subject: resolve: use set_dump_sorted() at one more place X-Git-Tag: v258-rc1~807^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dcf1c14b95e6b52eae8c52ea6e2e39a61400c637;p=thirdparty%2Fsystemd.git resolve: use set_dump_sorted() at one more place --- diff --git a/src/resolve/resolved-dns-trust-anchor.c b/src/resolve/resolved-dns-trust-anchor.c index 18059379a17..416eb942940 100644 --- a/src/resolve/resolved-dns-trust-anchor.c +++ b/src/resolve/resolved-dns-trust-anchor.c @@ -14,7 +14,6 @@ #include "resolved-dns-dnssec.h" #include "resolved-dns-trust-anchor.h" #include "set.h" -#include "sort-util.h" #include "string-util.h" #include "strv.h" @@ -477,10 +476,6 @@ static int dns_trust_anchor_load_files( return 0; } -static int domain_name_cmp(char * const *a, char * const *b) { - return dns_name_compare_func(*a, *b); -} - static int dns_trust_anchor_dump(DnsTrustAnchor *d) { DnsAnswer *a; @@ -503,12 +498,9 @@ static int dns_trust_anchor_dump(DnsTrustAnchor *d) { else { _cleanup_free_ char **l = NULL, *j = NULL; - l = set_get_strv(d->negative_by_name); - if (!l) + if (set_dump_sorted(d->negative_by_name, (void***) &l, /* ret_n = */ NULL) < 0) return log_oom(); - typesafe_qsort(l, set_size(d->negative_by_name), domain_name_cmp); - j = strv_join(l, " "); if (!j) return log_oom();