summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-08-30 17:13:53 -0600
committerEric Blake <eblake@redhat.com>2010-08-30 17:32:18 -0600
commit92486154f51fbed2b418b40aeb9c66ca6cf73f3f (patch)
tree5724c11ca19711a43d485b301d02e699841dbccf /m4
parent5f7e1792022e170a439dc052ecbad4a549157872 (diff)
downloadgnulib-92486154f51fbed2b418b40aeb9c66ca6cf73f3f.tar.gz
strstr, memmem, strcasestr: avoid leaked shell message
* m4/strstr.m4 (gl_FUNC_STRSTR): Avoid "Alarm clock" message from FreeBSD. * m4/strcasestr.m4 (gl_FUNC_STRCASESTR): Likewise. * m4/memmem.m4 (gl_FUNC_MEMMEM): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'm4')
-rw-r--r--m4/memmem.m45
-rw-r--r--m4/strcasestr.m45
-rw-r--r--m4/strstr.m45
3 files changed, 9 insertions, 6 deletions
diff --git a/m4/memmem.m4 b/m4/memmem.m4
index c6506ee5c8..d02b993593 100644
--- a/m4/memmem.m4
+++ b/m4/memmem.m4
@@ -1,4 +1,4 @@
-# memmem.m4 serial 14
+# memmem.m4 serial 15
dnl Copyright (C) 2002, 2003, 2004, 2007, 2008, 2009, 2010 Free Software
dnl Foundation, Inc.
dnl This file is free software; the Free Software Foundation
@@ -32,13 +32,14 @@ AC_DEFUN([gl_FUNC_MEMMEM],
#include <string.h> /* for memmem */
#include <stdlib.h> /* for malloc */
#include <unistd.h> /* for alarm */
+static void quit (int sig) { exit (sig + 128); }
]], [[size_t m = 1000000;
char *haystack = (char *) malloc (2 * m + 1);
char *needle = (char *) malloc (m + 1);
void *result = 0;
/* Failure to compile this test due to missing alarm is okay,
since all such platforms (mingw) also lack memmem. */
- signal (SIGALRM, SIG_DFL);
+ signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
if (haystack && needle)
diff --git a/m4/strcasestr.m4 b/m4/strcasestr.m4
index 6e940bcb6d..50ac0a7728 100644
--- a/m4/strcasestr.m4
+++ b/m4/strcasestr.m4
@@ -1,4 +1,4 @@
-# strcasestr.m4 serial 13
+# strcasestr.m4 serial 14
dnl Copyright (C) 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -39,13 +39,14 @@ AC_DEFUN([gl_FUNC_STRCASESTR],
#include <string.h> /* for memmem */
#include <stdlib.h> /* for malloc */
#include <unistd.h> /* for alarm */
+static void quit (int sig) { exit (sig + 128); }
]], [[size_t m = 1000000;
char *haystack = (char *) malloc (2 * m + 2);
char *needle = (char *) malloc (m + 2);
void *result = 0;
/* Failure to compile this test due to missing alarm is okay,
since all such platforms (mingw) also lack strcasestr. */
- signal (SIGALRM, SIG_DFL);
+ signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
if (haystack && needle)
diff --git a/m4/strstr.m4 b/m4/strstr.m4
index 779957aac9..3e45a7a082 100644
--- a/m4/strstr.m4
+++ b/m4/strstr.m4
@@ -1,4 +1,4 @@
-# strstr.m4 serial 7
+# strstr.m4 serial 8
dnl Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -27,13 +27,14 @@ AC_DEFUN([gl_FUNC_STRSTR],
#include <string.h> /* for memmem */
#include <stdlib.h> /* for malloc */
#include <unistd.h> /* for alarm */
+static void quit (int sig) { exit (sig + 128); }
]], [[size_t m = 1000000;
char *haystack = (char *) malloc (2 * m + 2);
char *needle = (char *) malloc (m + 2);
void *result = 0;
/* Failure to compile this test due to missing alarm is okay,
since all such platforms (mingw) also have quadratic strstr. */
- signal (SIGALRM, SIG_DFL);
+ signal (SIGALRM, quit);
alarm (5);
/* Check for quadratic performance. */
if (haystack && needle)