diff options
author | Eric Faurot <eric@cvs.openbsd.org> | 2012-04-14 12:06:14 +0000 |
---|---|---|
committer | Eric Faurot <eric@cvs.openbsd.org> | 2012-04-14 12:06:14 +0000 |
commit | 1035f26f14674e2605b7150a8f23e4d132e082d5 (patch) | |
tree | d32a73eb7c0e929b5454854bc09c4e80094284f9 /lib | |
parent | 85cc4a99c802e4f8d48287e81040db2a246d08df (diff) |
only define DEBUG internally
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/asr/Makefile.inc | 3 | ||||
-rw-r--r-- | lib/libc/asr/asr.c | 12 | ||||
-rw-r--r-- | lib/libc/asr/asr_private.h | 4 |
3 files changed, 10 insertions, 9 deletions
diff --git a/lib/libc/asr/Makefile.inc b/lib/libc/asr/Makefile.inc index f875dcf91b2..4665321e87d 100644 --- a/lib/libc/asr/Makefile.inc +++ b/lib/libc/asr/Makefile.inc @@ -1,9 +1,8 @@ -# $OpenBSD: Makefile.inc,v 1.1 2012/04/14 09:24:18 eric Exp $ +# $OpenBSD: Makefile.inc,v 1.2 2012/04/14 12:06:13 eric Exp $ # asr sources .PATH: ${LIBCSRCDIR}/asr -CFLAGS+=-DDEBUG SRCS+= asr.c asr_debug.c asr_utils.c \ res_send_async.c res_search_async.c getrrsetbyname_async.c \ gethostnamadr_async.c getnetnamadr_async.c \ diff --git a/lib/libc/asr/asr.c b/lib/libc/asr/asr.c index 0980a739ba8..bf0238c1e0d 100644 --- a/lib/libc/asr/asr.c +++ b/lib/libc/asr/asr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asr.c,v 1.1 2012/04/14 09:24:18 eric Exp $ */ +/* $OpenBSD: asr.c,v 1.2 2012/04/14 12:06:13 eric Exp $ */ /* * Copyright (c) 2010-2012 Eric Faurot <eric@openbsd.org> * @@ -894,7 +894,7 @@ int asr_iter_db(struct async *as) { if (as->as_db_idx >= as->as_ctx->ac_dbcount) { -#if DEBUG +#ifdef DEBUG asr_printf("asr_iter_db: done\n"); #endif return (-1); @@ -902,7 +902,7 @@ asr_iter_db(struct async *as) as->as_db_idx += 1; as->as_ns_idx = 0; -#if DEBUG +#ifdef DEBUG asr_printf("asr_iter_db: %i\n", as->as_db_idx); #endif return (0); @@ -926,7 +926,7 @@ asr_iter_ns(struct async *as) break; as->as_ns_idx = 0; as->as_ns_cycles++; -#if DEBUG +#ifdef DEBUG asr_printf("asr: asr_iter_ns(): cycle %i\n", as->as_ns_cycles); #endif } @@ -967,7 +967,7 @@ asr_iter_domain(struct async *as, const char *name, char * buf, size_t len) * don't try anything else. */ if (strlen(name) && name[strlen(name) - 1] == '.') { -#if DEBUG +#ifdef DEBUG asr_printf("asr: asr_iter_domain(\"%s\") fqdn\n", name); #endif as->as_dom_flags |= ASYNC_DOM_FQDN; @@ -982,7 +982,7 @@ asr_iter_domain(struct async *as, const char *name, char * buf, size_t len) if ((as->as_ctx->ac_options & RES_NOALIASES) == 0 && asr_ndots(name) == 0 && (alias = asr_hostalias(name, buf, len)) != NULL) { -#if DEBUG +#ifdef DEBUG asr_printf("asr: asr_iter_domain(\"%s\") is alias " "\"%s\"\n", name, alias); #endif diff --git a/lib/libc/asr/asr_private.h b/lib/libc/asr/asr_private.h index bd86912e92e..ee636f1657f 100644 --- a/lib/libc/asr/asr_private.h +++ b/lib/libc/asr/asr_private.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asr_private.h,v 1.1 2012/04/14 09:24:18 eric Exp $ */ +/* $OpenBSD: asr_private.h,v 1.2 2012/04/14 12:06:13 eric Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> * @@ -16,6 +16,8 @@ */ #include <stdio.h> +#define DEBUG + #define QR_MASK (0x1 << 15) #define OPCODE_MASK (0xf << 11) #define AA_MASK (0x1 << 10) |