From: Bruno Haible Date: Sat, 22 Oct 2011 12:25:26 +0000 (+0200) Subject: perror: Recognize when test program crashes. X-Git-Tag: v0.1~1542 X-Git-Url: https://erislabs.net/gitweb/?a=commitdiff_plain;h=b3609c143bda48f4770412e689443601527f8e5b;p=gnulib.git 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. . --- diff --git a/ChangeLog b/ChangeLog index 5e37e704f..7f591a2af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-10-22 Bruno Haible + 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. . + perror: Fix indentation. * m4/perror.m4 (gl_FUNC_PERROR): Fix indentation. diff --git a/m4/perror.m4 b/m4/perror.m4 index 6a2d9b242..cb17ba38b 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