]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: use set_dump_sorted() at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 15 Apr 2025 20:38:13 +0000 (05:38 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 15 Apr 2025 23:16:21 +0000 (08:16 +0900)
src/resolve/resolved-dns-trust-anchor.c

index 18059379a17eeb19b407e8f616479a5f83bc952d..416eb9429403483040d94b8c14352dd084d3d347 100644 (file)
@@ -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();