summaryrefslogtreecommitdiff
path: root/m4/perror.m4
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-10-22 14:25:26 +0200
committerBruno Haible <bruno@clisp.org>2011-10-22 14:25:26 +0200
commitb3609c143bda48f4770412e689443601527f8e5b (patch)
treeb533f5636df2a457c45d6d18950267564cdf2fce /m4/perror.m4
parent3258ce39ae1d5833c693ac4b75cb4a4b218a2159 (diff)
downloadgnulib-b3609c143bda48f4770412e689443601527f8e5b.tar.gz
perror: Recognize when test program crashes.
* m4/perror.m4 (gl_FUNC_PERROR): If the test program crashes due to strerror, set gl_cv_func_perror_works to no. Reported by Daniel Richard G. <skunk@iskunk.org>.
Diffstat (limited to 'm4/perror.m4')
-rw-r--r--m4/perror.m47
1 files changed, 4 insertions, 3 deletions
diff --git a/m4/perror.m4 b/m4/perror.m4
index 6a2d9b2423..cb17ba38be 100644
--- a/m4/perror.m4
+++ b/m4/perror.m4
@@ -1,4 +1,4 @@
-# perror.m4 serial 5
+# perror.m4 serial 6
dnl Copyright (C) 2008-2011 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -36,9 +36,10 @@ AC_DEFUN([gl_FUNC_PERROR],
puts (str);
errno = -1;
perror ("");
+ return 0;
]])],
- [CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2
- if cmp conftest.txt1 conftest.txt2 >/dev/null; then
+ [if CONFTEST_OUTPUT=1 ./conftest$EXEEXT >conftest.txt1 2>conftest.txt2 \
+ && cmp conftest.txt1 conftest.txt2 >/dev/null; then
gl_cv_func_perror_works=yes
else
gl_cv_func_perror_works=no