From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2251 invoked by alias); 12 Aug 2004 14:46:03 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 2182 invoked from network); 12 Aug 2004 14:45:57 -0000 Received: from unknown (HELO sunsite.ms.mff.cuni.cz) (195.113.15.26) by sourceware.org with SMTP; 12 Aug 2004 14:45:57 -0000 Received: from sunsite.ms.mff.cuni.cz (sunsite.mff.cuni.cz [127.0.0.1]) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8) with ESMTP id i7CCSu3j018741; Thu, 12 Aug 2004 14:28:56 +0200 Received: (from jakub@localhost) by sunsite.ms.mff.cuni.cz (8.12.8/8.12.8/Submit) id i7CCSqVG018732; Thu, 12 Aug 2004 14:28:52 +0200 Date: Thu, 12 Aug 2004 14:46:00 -0000 From: Jakub Jelinek To: Ulrich Drepper , Roland McGrath Cc: Glibc hackers Subject: [PATCH] Avoid unconditional debugging printf in res_query.c Message-ID: <20040812122852.GA30497@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i X-SW-Source: 2004-08/txt/msg00044.txt.bz2 Hi! We certainly shouldn't pollute stdout by default... 2004-08-12 Jakub Jelinek * resolv/res_query.c (__libc_res_nsearch): Protect the debugging printf with #ifdef DEBUG and RES_DEBUG check. --- libc/resolv/res_query.c.jj 2004-08-12 16:38:52.000000000 +0200 +++ libc/resolv/res_query.c 2004-08-12 16:42:09.696933969 +0200 @@ -239,8 +239,11 @@ __libc_res_nsearch(res_state statp, return (__libc_res_nquery(statp, cp, class, type, answer, anslen, answerp)); - printf("dots=%d, statp->ndots=%d, trailing_dot=%d, name=%s\n", - (int)dots,(int)statp->ndots,(int)trailing_dot,name); +#ifdef DEBUG + if (statp->options & RES_DEBUG) + printf("dots=%d, statp->ndots=%d, trailing_dot=%d, name=%s\n", + (int)dots,(int)statp->ndots,(int)trailing_dot,name); +#endif /* * If there are enough dots in the name, let's just give it a Jakub