Consistently use exit code 1 (== POSIX's EXIT_FAILURE) if things
go wrong. As we can tell from the error messages what whent wrong
there is no need to have different exit codes to distinguish.
Spotted by Matthias Schwarzott.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15515 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c
index 76efc10..604e05a 100644
--- a/coregrind/m_replacemalloc/vg_replace_malloc.c
+++ b/coregrind/m_replacemalloc/vg_replace_malloc.c
@@ -1078,8 +1078,7 @@
static void panic(const char *str)
{
VALGRIND_PRINTF_BACKTRACE("Program aborting because of call to %s\n", str);
- my_exit(99);
- *(volatile int *)0 = 'x';
+ my_exit(1);
}
#define PANIC(soname, fnname) \
diff --git a/shared/vg_replace_strmem.c b/shared/vg_replace_strmem.c
index e092618..0f2cb7d 100644
--- a/shared/vg_replace_strmem.c
+++ b/shared/vg_replace_strmem.c
@@ -1325,7 +1325,7 @@
VALGRIND_PRINTF_BACKTRACE( \
"*** memmove_chk: buffer overflow detected ***: " \
"program terminated\n"); \
- my_exit(127); \
+ my_exit(1); \
/*NOTREACHED*/ \
return NULL; \
}
@@ -1417,7 +1417,7 @@
VALGRIND_PRINTF_BACKTRACE( \
"*** strcpy_chk: buffer overflow detected ***: " \
"program terminated\n"); \
- my_exit(127); \
+ my_exit(1); \
/*NOTREACHED*/ \
return NULL; \
}
@@ -1452,7 +1452,7 @@
VALGRIND_PRINTF_BACKTRACE( \
"*** stpcpy_chk: buffer overflow detected ***: " \
"program terminated\n"); \
- my_exit(127); \
+ my_exit(1); \
/*NOTREACHED*/ \
return NULL; \
}
@@ -1552,7 +1552,7 @@
VALGRIND_PRINTF_BACKTRACE( \
"*** memcpy_chk: buffer overflow detected ***: " \
"program terminated\n"); \
- my_exit(127); \
+ my_exit(1); \
/*NOTREACHED*/ \
return NULL; \
}