changeset 38506:c12162373b76

error: Fix mistake in 2017-04-23 commit. * lib/error.c (print_errno_message): If GNULIB_STRERROR_R_POSIX is set, assume that strerror_r returns 'int', not 'char *'.
author Bruno Haible <bruno@clisp.org>
date Sat, 29 Apr 2017 23:01:39 +0200
parents 7a32650d21f3
children bd8f0df9494c
files ChangeLog lib/error.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Apr 29 15:05:15 2017 +0200
+++ b/ChangeLog	Sat Apr 29 23:01:39 2017 +0200
@@ -1,3 +1,9 @@
+2017-04-29  Bruno Haible  <bruno@clisp.org>
+
+	error: Fix mistake in 2017-04-23 commit.
+	* lib/error.c (print_errno_message): If GNULIB_STRERROR_R_POSIX is set,
+	assume that strerror_r returns 'int', not 'char *'.
+
 2017-04-29  Bruno Haible  <bruno@clisp.org>
 
 	stat: Fix time_t values and other problems on native Windows platforms.
--- a/lib/error.c	Sat Apr 29 15:05:15 2017 +0200
+++ b/lib/error.c	Sat Apr 29 23:01:39 2017 +0200
@@ -174,7 +174,7 @@
 
 #if _LIBC || GNULIB_STRERROR_R_POSIX || defined HAVE_STRERROR_R
   char errbuf[1024];
-# if _LIBC || GNULIB_STRERROR_R_POSIX || STRERROR_R_CHAR_P
+# if _LIBC || (!GNULIB_STRERROR_R_POSIX && STRERROR_R_CHAR_P)
   s = __strerror_r (errnum, errbuf, sizeof errbuf);
 # else
   if (__strerror_r (errnum, errbuf, sizeof errbuf) == 0)