From: Brian Wellington Date: Fri, 13 Oct 2000 22:55:50 +0000 (+0000) Subject: dig now calls isc_mem_stats() only if -m was specified, not if X-Git-Tag: v9.0.1^4~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2babfac176033ebae5b8faf59935b24f2458643;p=thirdparty%2Fbind9.git dig now calls isc_mem_stats() only if -m was specified, not if isc_mem_debugging was set elsewhere. --- diff --git a/bin/dig/dig.c b/bin/dig/dig.c index dc34a05bb36..2792f5c24c4 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.112 2000/10/13 17:53:57 mws Exp $ */ +/* $Id: dig.c,v 1.113 2000/10/13 22:55:49 bwelling Exp $ */ #include #include @@ -78,7 +78,7 @@ dig_lookup_t *default_lookup = NULL; extern isc_uint32_t name_limit; extern isc_uint32_t rr_limit; -extern isc_boolean_t debugging, show_packets; +extern isc_boolean_t debugging, memdebugging, show_packets; char *batchname = NULL; FILE *batchfp = NULL; char *argv0; @@ -911,6 +911,7 @@ dash_option(char *option, char *next, dig_lookup_t **lookup, exit(0); break; case 'm': + memdebugging = ISC_TRUE; isc_mem_debugging = ISC_MEM_DEBUGTRACE | ISC_MEM_DEBUGRECORD; return (ISC_FALSE); case 'n': diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index eac7dc65ace..ef934766f5e 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.144 2000/10/13 17:53:58 mws Exp $ */ +/* $Id: dighost.c,v 1.145 2000/10/13 22:55:50 bwelling Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -118,6 +118,7 @@ isc_boolean_t validated = ISC_TRUE; isc_entropy_t *entp = NULL; isc_mempool_t *commctx = NULL; isc_boolean_t debugging = ISC_FALSE; +isc_boolean_t memdebugging = ISC_FALSE; char *progname = NULL; isc_mutex_t lookup_lock; dig_lookup_t *current_lookup = NULL; @@ -2711,7 +2712,7 @@ destroy_libs(void) { UNLOCK_LOOKUP; DESTROYLOCK(&lookup_lock); - if (isc_mem_debugging != 0) + if (memdebugging) isc_mem_stats(mctx, stderr); if (mctx != NULL) isc_mem_destroy(&mctx);