From 4fe68d4176b4f0da64660bb9ce0f5412a6bb24de Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 19 May 2011 20:45:59 +0200 Subject: [PATCH] strerror_r: Fix test failure on mingw. * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define EXTEND_STRERROR_R. * lib/strerror_r.c (strerror_r): Test the various GNULIB_defined_* macros from errno.in.h instead. --- ChangeLog | 8 ++++++++ lib/strerror_r.c | 14 +++++++++++++- m4/strerror_r.m4 | 5 +---- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b90c116139..92c55b552f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-05-19 Bruno Haible + + strerror_r: Fix test failure on mingw. + * m4/strerror_r.m4 (gl_FUNC_STRERROR_R): Don't define + EXTEND_STRERROR_R. + * lib/strerror_r.c (strerror_r): Test the various GNULIB_defined_* + macros from errno.in.h instead. + 2011-05-19 Eric Blake strerror: relax test for Solaris diff --git a/lib/strerror_r.c b/lib/strerror_r.c index fc0603cb31..aa0da372bc 100644 --- a/lib/strerror_r.c +++ b/lib/strerror_r.c @@ -64,7 +64,19 @@ int strerror_r (int errnum, char *buf, size_t buflen) #undef strerror_r { -#if EXTEND_STRERROR_R +#if GNULIB_defined_ETXTBSY \ + || GNULIB_defined_ESOCK \ + || GNULIB_defined_ENOMSG \ + || GNULIB_defined_EIDRM \ + || GNULIB_defined_ENOLINK \ + || GNULIB_defined_EPROTO \ + || GNULIB_defined_EMULTIHOP \ + || GNULIB_defined_EBADMSG \ + || GNULIB_defined_EOVERFLOW \ + || GNULIB_defined_ENOTSUP \ + || GNULIB_defined_ESTALE \ + || GNULIB_defined_EDQUOT \ + || GNULIB_defined_ECANCELED { char const *msg = NULL; /* These error messages are taken from glibc/sysdeps/gnu/errlist.c. */ diff --git a/m4/strerror_r.m4 b/m4/strerror_r.m4 index ca3904c272..744488d84f 100644 --- a/m4/strerror_r.m4 +++ b/m4/strerror_r.m4 @@ -1,4 +1,4 @@ -# strerror_r.m4 serial 4 +# strerror_r.m4 serial 5 dnl Copyright (C) 2002, 2007-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, @@ -93,9 +93,6 @@ changequote([,])dnl dnl The system's strerror_r() cannot know about the new errno values we dnl add to . Replace it. REPLACE_STRERROR_R=1 - AC_DEFINE([EXTEND_STRERROR_R], [1], - [Define to 1 if strerror_r needs to be extended so that it handles the - extra errno values.]) fi fi if test $HAVE_DECL_STRERROR_R = 0 || test $REPLACE_STRERROR_R = 1; then -- 2.30.2