index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | src/pacman/pacman.c | 32 |
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) { |