From: Nikos Mavrogiannopoulos Date: Fri, 13 May 2016 19:10:03 +0000 (-0700) Subject: intdiv0, memmem, nocrash, strcasestr, strstr: no exit X-Git-Tag: v1.0~6742 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=3588af7e6ad4282c1482f95a9608fefca5123776;p=gnulib.git intdiv0, memmem, nocrash, strcasestr, strstr: no exit Do not call 'exit' in a signal handler, as this is not portable. Call '_exit' instead. This addresses an issue with tests not being terminated. --- diff --git a/m4/intdiv0.m4 b/m4/intdiv0.m4 index a442fd5bb3..744b99ea8d 100644 --- a/m4/intdiv0.m4 +++ b/m4/intdiv0.m4 @@ -38,7 +38,7 @@ static void sigfpe_handler (int sig) { /* Exit with code 0 if SIGFPE, with code 1 if any other signal. */ - exit (sig != SIGFPE); + _exit (sig != SIGFPE); } int x = 1; diff --git a/m4/memmem.m4 b/m4/memmem.m4 index 624e9b82d4..981ede76b4 100644 --- a/m4/memmem.m4 +++ b/m4/memmem.m4 @@ -93,7 +93,7 @@ AC_DEFUN([gl_FUNC_MEMMEM], #include /* for memmem */ #include /* for malloc */ #include /* for alarm */ -static void quit (int sig) { exit (sig + 128); } +static void quit (int sig) { _exit (sig + 128); } ]], [[ int result = 0; size_t m = 1000000; diff --git a/m4/nocrash.m4 b/m4/nocrash.m4 index ecc55c6172..d8dd8f13a1 100644 --- a/m4/nocrash.m4 +++ b/m4/nocrash.m4 @@ -110,11 +110,12 @@ nocrash_init (void) #else /* Avoid a crash on POSIX systems. */ #include +#include /* A POSIX signal handler. */ static void exception_handler (int sig) { - exit (1); + _exit (1); } static void nocrash_init (void) diff --git a/m4/strcasestr.m4 b/m4/strcasestr.m4 index 7c44cdd670..bed57710bc 100644 --- a/m4/strcasestr.m4 +++ b/m4/strcasestr.m4 @@ -80,7 +80,7 @@ AC_DEFUN([gl_FUNC_STRCASESTR], #include /* for strcasestr */ #include /* for malloc */ #include /* for alarm */ -static void quit (int sig) { exit (sig + 128); } +static void quit (int sig) { _exit (sig + 128); } ]], [[ int result = 0; size_t m = 1000000; diff --git a/m4/strstr.m4 b/m4/strstr.m4 index b2a3646dc2..77db2a47f9 100644 --- a/m4/strstr.m4 +++ b/m4/strstr.m4 @@ -71,7 +71,7 @@ AC_DEFUN([gl_FUNC_STRSTR], #include /* for strstr */ #include /* for malloc */ #include /* for alarm */ -static void quit (int sig) { exit (sig + 128); } +static void quit (int sig) { _exit (sig + 128); } ]], [[ int result = 0; size_t m = 1000000;