From 2d3a707a0567d1c3eb48527cb0edf21d15ba97ae Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Thu, 9 Nov 2006 19:27:10 +0000 Subject: mcheck() seems to cause segfaults. Annoying. Switched back to useing mtrace() - if anything valgrind is superior to mcheck anyway --- src/pacman/pacman.c | 32 +++++--------------------------- 1 file changed, 5 insertions(+), 27 deletions(-) (limited to 'src/pacman/pacman.c') diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index 30d28f72..07994a09 100644 --- a/src/pacman/pacman.c +++ b/src/pacman/pacman.c @@ -85,32 +85,6 @@ unsigned int maxcols = 80; extern int neednl; -#if defined(PACMAN_DEBUG) && !defined(CYGWIN) && !defined(BSD) -void mcheck_abort(enum mcheck_status status) -{ - switch(status) - { - case MCHECK_DISABLED: - fputs("mcheck: disabled, no checking can be done\n", stderr); - break; - case MCHECK_OK: - fputs("mcheck: block ok", stderr); - break; - case MCHECK_HEAD: - fputs("mcheck: inconsistancy at block head (underrun)\n", stderr); - abort(); - break; - case MCHECK_TAIL: - fputs("mcheck: inconsistancy at block tail (overrun)\n", stderr); - abort(); - break; - case MCHECK_FREE: - fputs("mcheck: block has already been freed\n", stderr); - break; - }; -} -#endif - /* Display usage/syntax for the specified operation. * op: the operation code requested * myname: basename(argv[0]) @@ -437,7 +411,11 @@ int main(int argc, char *argv[]) list_t *lp; #if defined(PACMAN_DEBUG) && !defined(CYGWIN) && !defined(BSD) - mcheck(mcheck_abort); + char *malloc_trace = (char *)getenv("MALLOC_TRACE"); + if(!malloc_trace) { + setenv("MALLOC_TRACE=pacman.mtrace"); + } + mtrace(); #endif cenv = getenv("COLUMNS"); if(cenv != NULL) { -- cgit v1.2.3-70-g09d2