From: Yu Watanabe Date: Mon, 25 Jun 2018 04:46:52 +0000 (+0900) Subject: resolve: drop dead code X-Git-Tag: v240~1051^2~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6da95857c19202120af76871c91a47a0f23aed8d;p=thirdparty%2Fsystemd.git resolve: drop dead code --- diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c index c921fe841fe..746ff1b8bec 100644 --- a/src/resolve/resolved-dns-query.c +++ b/src/resolve/resolved-dns-query.c @@ -554,17 +554,13 @@ static int dns_query_add_candidate(DnsQuery *q, DnsScope *s) { return r; /* If this a single-label domain on DNS, we might append a suitable search domain first. */ - if ((q->flags & SD_RESOLVED_NO_SEARCH) == 0) { - r = dns_scope_name_needs_search_domain(s, dns_question_first_name(q->question_idna)); - if (r < 0) - goto fail; - if (r > 0) { - /* OK, we need a search domain now. Let's find one for this scope */ + if ((q->flags & SD_RESOLVED_NO_SEARCH) == 0 && + dns_scope_name_needs_search_domain(s, dns_question_first_name(q->question_idna))) { + /* OK, we need a search domain now. Let's find one for this scope */ - r = dns_query_candidate_next_search_domain(c); - if (r <= 0) /* if there's no search domain, then we won't add any transaction. */ - goto fail; - } + r = dns_query_candidate_next_search_domain(c); + if (r <= 0) /* if there's no search domain, then we won't add any transaction. */ + goto fail; } r = dns_query_candidate_setup_transactions(c);