From: Lennart Poettering Date: Tue, 5 Jan 2016 19:27:29 +0000 (+0100) Subject: resolved: when dumping trust anchor contents, clarify when it is empty X-Git-Tag: v229~161^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=105f6c4bdcdd9c7233370f1bc143913d5ab0d099;p=thirdparty%2Fsystemd.git resolved: when dumping trust anchor contents, clarify when it is empty --- diff --git a/src/resolve/resolved-dns-trust-anchor.c b/src/resolve/resolved-dns-trust-anchor.c index 53b49b091a1..0f346956963 100644 --- a/src/resolve/resolved-dns-trust-anchor.c +++ b/src/resolve/resolved-dns-trust-anchor.c @@ -346,15 +346,21 @@ static void dns_trust_anchor_dump(DnsTrustAnchor *d) { assert(d); - log_info("Positive Trust Anchors:"); - HASHMAP_FOREACH(a, d->positive_by_key, i) { - DnsResourceRecord *rr; - - DNS_ANSWER_FOREACH(rr, a) - log_info("%s", dns_resource_record_to_string(rr)); + if (hashmap_isempty(d->positive_by_key)) + log_info("No positive trust anchors defined."); + else { + log_info("Positive Trust Anchors:"); + HASHMAP_FOREACH(a, d->positive_by_key, i) { + DnsResourceRecord *rr; + + DNS_ANSWER_FOREACH(rr, a) + log_info("%s", dns_resource_record_to_string(rr)); + } } - if (!set_isempty(d->negative_by_name)) { + if (set_isempty(d->negative_by_name)) + log_info("No negative trust anchors defined."); + else { char *n; log_info("Negative trust anchors:");