From patchwork Sat Dec 1 20:13:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 30510 Received: (qmail 105111 invoked by alias); 1 Dec 2018 20:13:37 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 104921 invoked by uid 89); 1 Dec 2018 20:13:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=*msg, 6717, Hx-languages-length:1995 X-HELO: mx1.redhat.com From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH] resolv: Remove debugging code from compat-gethnamaddr.c Date: Sat, 01 Dec 2018 21:13:21 +0100 Message-ID: <87efb1m2e6.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 2018-12-01 Florian Weimer * resolv/compat-gethnamaddr.c (Dprintf): Remove definition. (getanswer): Do not call Dprintf. (res_gethostbyname2_context): Likewise. (res_gethostbyaddr_context): Likewise. diff --git a/resolv/compat-gethnamaddr.c b/resolv/compat-gethnamaddr.c index 259378b2be..0e24dcbbcc 100644 --- a/resolv/compat-gethnamaddr.c +++ b/resolv/compat-gethnamaddr.c @@ -119,21 +119,6 @@ typedef union { extern int h_errno; # endif -# ifdef DEBUG -static void -Dprintf (char *msg, int num) -{ - if (_res.options & RES_DEBUG) { - int save = errno; - - printf(msg, num); - __set_errno (save); - } -} -# else -# define Dprintf(msg, num) /*nada*/ -# endif - # define BOUNDED_INCR(x) \ do { \ cp += x; \ @@ -162,7 +147,6 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) char *bp, **ap, **hap; int type, class, buflen, ancount, qdcount; int haveanswer, had_error; - int toobig = 0; char tbuf[MAXDNAME]; const char *tname; int (*name_ok) (const char *); @@ -370,15 +354,10 @@ getanswer (const querybuf *answer, int anslen, const char *qname, int qtype) bp += sizeof(align) - ((u_long)bp % sizeof(align)); if (bp + n >= &hostbuf[sizeof hostbuf]) { - Dprintf("size (%d) too big\n", n); had_error++; continue; } if (hap >= &h_addr_ptrs[MAXADDRS-1]) { - if (!toobig++) { - Dprintf("Too many addresses (%d)\n", - MAXADDRS); - } cp += n; continue; } @@ -572,7 +551,6 @@ res_gethostbyname2_context (struct resolv_context *ctx, &buf.ptr, NULL, NULL, NULL, NULL)) < 0) { if (buf.buf != origbuf) free (buf.buf); - Dprintf("res_nsearch failed (%d)\n", n); if (errno == ECONNREFUSED) return (_gethtbyname2(name, af)); return (NULL); @@ -671,7 +649,6 @@ res_gethostbyaddr_context (struct resolv_context *ctx, if (n < 0) { if (buf.buf != orig_buf) free (buf.buf); - Dprintf("res_nquery failed (%d)\n", n); if (errno == ECONNREFUSED) return (_gethtbyaddr(addr, len, af)); return (NULL);