[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/2] strerror_r-posix: work around cygwin 1.7.9
From: |
Eric Blake |
Subject: |
Re: [PATCH 2/2] strerror_r-posix: work around cygwin 1.7.9 |
Date: |
Wed, 08 Jun 2011 05:12:10 -0600 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10 |
On 06/08/2011 04:36 AM, Bruno Haible wrote:
> Hi Eric,
>
>> the 'strerror' module in isolation will not replace strerror, but
>> if strerror_r is in use for any other reason, then the two use
>> separate buffers.
>
> Very nice. Good improvement.
>
> I'm applying a couple of follow-up tweaks:
Thanks. I've got one more, moving some prereq code out of strerror into
strerror-override (and particularly needed to make strerror_r work on
mingw, if I understand correctly, although I have not yet tested mingw,
so there may be more fallout). See below.
> - gl_PREREQ_STRERROR_R needs to test whether __xpg_strerror_r exists, since
> lib/strerror_r.c tests HAVE___XPG_STRERROR_R. Until two weeks ago, there
> was the assumption that it had already been tested by gl_FUNC_STRERROR_R,
> but that's not the case any more since we have added the 'test -z
> "$ERRNO_H"'
> and since the list of platforms that have __xpg_strerror_r now includes
> Cygwin (for which "$ERRNO_H" ends up non-empty).
Actually, "$ERRNO_H" is non-empty on cygwin 1.5, but that also lacks
__xpg_strerror_r. Cygwin 1.7 does not need a replacement <errno.h>.
diff --git c/ChangeLog i/ChangeLog
index d57fd3f..7e9ad87 100644
--- c/ChangeLog
+++ i/ChangeLog
@@ -1,3 +1,11 @@
+2011-06-08 Eric Blake <address@hidden>
+
+ strerror: simplify replacement
+ * m4/strerror.m4 (gl_PREREQ_STRERROR): Delete.
+ * modules/strerror (configure.ac): No prereqs needed here...
+ * modules/strerror-override (configure.ac): ...but this needs it.
+ (Files): Add file for needed prereq macro.
+
2011-06-08 Bruno Haible <address@hidden>
strerror_r-posix: Tweaks.
diff --git c/m4/strerror.m4 i/m4/strerror.m4
index 1ae1a2d..048b03c 100644
--- c/m4/strerror.m4
+++ i/m4/strerror.m4
@@ -1,4 +1,4 @@
-# strerror.m4 serial 13
+# strerror.m4 serial 14
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,
@@ -48,16 +48,3 @@ AC_DEFUN([gl_FUNC_STRERROR],
REPLACE_STRERROR=1
fi
])
-
-# Prerequisites of lib/strerror.c.
-AC_DEFUN([gl_PREREQ_STRERROR], [
- AC_CHECK_DECLS([strerror])
- AC_CHECK_HEADERS_ONCE([sys/socket.h])
- if test $ac_cv_header_sys_socket_h != yes; then
- dnl We cannot use AC_CHECK_HEADERS_ONCE here, because that would make
- dnl the check for those headers unconditional; yet cygwin reports
- dnl that the headers are present but cannot be compiled (since on
- dnl cygwin, all socket information should come from sys/socket.h).
- AC_CHECK_HEADERS([winsock2.h])
- fi
-])
diff --git c/modules/strerror i/modules/strerror
index a0b7014..1d60662 100644
--- c/modules/strerror
+++ i/modules/strerror
@@ -16,7 +16,6 @@ configure.ac:
gl_FUNC_STRERROR
if test $REPLACE_STRERROR = 1; then
AC_LIBOBJ([strerror])
- gl_PREREQ_STRERROR
fi
gl_MODULE_INDICATOR([strerror])
gl_STRING_MODULE_INDICATOR([strerror])
diff --git c/modules/strerror-override i/modules/strerror-override
index a31e8a1..bbdf7b8 100644
--- c/modules/strerror-override
+++ i/modules/strerror-override
@@ -4,6 +4,7 @@ strerror_override() function: provide strings for
gnulib-specific errno values
Files:
lib/strerror-override.h
lib/strerror-override.c
+m4/sys_socket_h.m4
Depends-on:
errno
@@ -12,6 +13,7 @@ configure.ac:
AC_REQUIRE([gl_HEADER_ERRNO_H])
if test -n "$ERRNO_H"; then
AC_LIBOBJ([strerror-override])
+ gl_PREREQ_SYS_H_WINSOCK2
fi
Makefile.am:
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature