summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAaron Griffin <aaron@archlinux.org>2006-11-09 19:27:10 +0000
committerAaron Griffin <aaron@archlinux.org>2006-11-09 19:27:10 +0000
commit2d3a707a0567d1c3eb48527cb0edf21d15ba97ae (patch)
tree2a8c60c0c18ebef74c6e20d14a293390a4be2f3b /src
parent3e608e7e858166a15eb929df4d66f35f5e4689c5 (diff)
mcheck() seems to cause segfaults. Annoying. Switched back to useing mtrace() - if anything valgrind is superior to mcheck anyway
Diffstat (limited to 'src')
-rw-r--r--src/pacman/pacman.c32
1 files changed, 5 insertions, 27 deletions
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) {