From: Mark Andrews Date: Tue, 23 May 2006 04:37:28 +0000 (+0000) Subject: 2029. [bug] host printed out the server multiple times when X-Git-Tag: v9.4.0b1~36^2~54 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=e22bd3c4bc0de0b96531fab5c2c944251e02e975;p=thirdparty%2Fbind9.git 2029. [bug] host printed out the server multiple times when specified on the command line. [RT #15992] --- diff --git a/CHANGES b/CHANGES index 769edd415c5..0aca9be232f 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2029. [bug] host printed out the server multiple times when + specified on the command line. [RT #15992] + 2028. [port] linux: socket.c compatability for old systems. [RT #16015] diff --git a/bin/dig/host.c b/bin/dig/host.c index 1582f31ce84..821bd877168 100644 --- a/bin/dig/host.c +++ b/bin/dig/host.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: host.c,v 1.108 2006/03/02 23:48:50 marka Exp $ */ +/* $Id: host.c,v 1.109 2006/05/23 04:37:28 marka Exp $ */ /*! \file */ @@ -48,6 +48,7 @@ static isc_boolean_t default_lookups = ISC_TRUE; static int seen_error = -1; static isc_boolean_t list_addresses = ISC_TRUE; static dns_rdatatype_t list_type = dns_rdatatype_a; +static printed_server = ISC_FALSE; static const char *opcodetext[] = { "QUERY", @@ -398,7 +399,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { */ force_error = (seen_error == 1) ? 1 : 0; seen_error = 1; - if (listed_server) { + if (listed_server && !printed_server) { char sockstr[ISC_SOCKADDR_FORMATSIZE]; printf("Using domain server:\n"); @@ -407,6 +408,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) { sizeof(sockstr)); printf("Address: %s\n", sockstr); printf("Aliases: \n\n"); + printed_server = ISC_TRUE; } if (msg->rcode != 0) {