dig now calls isc_mem_stats() only if -m was specified, not if

isc_mem_debugging was set elsewhere.
This commit is contained in:
Brian Wellington 2000-10-13 22:55:50 +00:00
parent 0df9b6e53b
commit e2babfac17
2 changed files with 6 additions and 4 deletions

View file

@ -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 <config.h>
#include <stdlib.h>
@ -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':

View file

@ -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);