From 8a615d0fa8537ee36ffacc45280d271c32d2799d Mon Sep 17 00:00:00 2001 From: Enji Cooper Date: Tue, 15 Dec 2015 05:37:09 +0000 Subject: [PATCH] Allow users override `DEBUG` on the command line via DEBUG_FLAGS="-DDEBUG" with lib/libc/resolv by conditionalizing its definition MFC after: 3 days Reviewed by: ume, vangyzen Differential Revision: https://reviews.freebsd.org/D4519 --- lib/libc/resolv/res_init.c | 4 +++- lib/libc/resolv/res_mkquery.c | 4 +++- lib/libc/resolv/res_mkupdate.c | 4 +++- lib/libc/resolv/res_query.c | 4 +++- lib/libc/resolv/res_send.c | 4 +++- 5 files changed, 15 insertions(+), 5 deletions(-) diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c index 8d59ebad534..8832342b105 100644 --- a/lib/libc/resolv/res_init.c +++ b/lib/libc/resolv/res_init.c @@ -116,7 +116,9 @@ __FBSDID("$FreeBSD$"); /*% Options. Should all be left alone. */ #define RESOLVSORT -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #ifdef SOLARIS2 #include diff --git a/lib/libc/resolv/res_mkquery.c b/lib/libc/resolv/res_mkquery.c index b60d8f53e49..0d45e34ddb1 100644 --- a/lib/libc/resolv/res_mkquery.c +++ b/lib/libc/resolv/res_mkquery.c @@ -83,7 +83,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif extern const char *_res_opcodes[]; diff --git a/lib/libc/resolv/res_mkupdate.c b/lib/libc/resolv/res_mkupdate.c index d4981a56328..c076c1e588c 100644 --- a/lib/libc/resolv/res_mkupdate.c +++ b/lib/libc/resolv/res_mkupdate.c @@ -54,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #define MAXPORT 1024 static int getnum_str(u_char **, u_char *); diff --git a/lib/libc/resolv/res_query.c b/lib/libc/resolv/res_query.c index 4ae97f64b12..5992edd8a7f 100644 --- a/lib/libc/resolv/res_query.c +++ b/lib/libc/resolv/res_query.c @@ -88,7 +88,9 @@ __FBSDID("$FreeBSD$"); #include "port_after.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #if PACKETSZ > 1024 #define MAXPACKET PACKETSZ diff --git a/lib/libc/resolv/res_send.c b/lib/libc/resolv/res_send.c index 56904915544..c127c3b856f 100644 --- a/lib/libc/resolv/res_send.c +++ b/lib/libc/resolv/res_send.c @@ -119,7 +119,9 @@ __FBSDID("$FreeBSD$"); #include "un-namespace.h" /* Options. Leave them on. */ -#define DEBUG +#ifndef DEBUG +#define DEBUG +#endif #include "res_debug.h" #include "res_private.h"