From 5685245df09417f62f6d02a0f540881310d3896c Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Sun, 9 Aug 2015 20:29:18 +0000 Subject: [PATCH] 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 --- coregrind/m_replacemalloc/vg_replace_malloc.c | 3 +-- shared/vg_replace_strmem.c | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 76efc1052d..604e05a61b 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) __attribute__((unused)); 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 e092618398..0f2cb7d5bf 100644 --- a/shared/vg_replace_strmem.c +++ b/shared/vg_replace_strmem.c @@ -1325,7 +1325,7 @@ static inline void my_exit ( int x ) VALGRIND_PRINTF_BACKTRACE( \ "*** memmove_chk: buffer overflow detected ***: " \ "program terminated\n"); \ - my_exit(127); \ + my_exit(1); \ /*NOTREACHED*/ \ return NULL; \ } @@ -1417,7 +1417,7 @@ static inline void my_exit ( int x ) VALGRIND_PRINTF_BACKTRACE( \ "*** strcpy_chk: buffer overflow detected ***: " \ "program terminated\n"); \ - my_exit(127); \ + my_exit(1); \ /*NOTREACHED*/ \ return NULL; \ } @@ -1452,7 +1452,7 @@ static inline void my_exit ( int x ) VALGRIND_PRINTF_BACKTRACE( \ "*** stpcpy_chk: buffer overflow detected ***: " \ "program terminated\n"); \ - my_exit(127); \ + my_exit(1); \ /*NOTREACHED*/ \ return NULL; \ } @@ -1552,7 +1552,7 @@ static inline void my_exit ( int x ) VALGRIND_PRINTF_BACKTRACE( \ "*** memcpy_chk: buffer overflow detected ***: " \ "program terminated\n"); \ - my_exit(127); \ + my_exit(1); \ /*NOTREACHED*/ \ return NULL; \ } -- 2.47.2