strerror_r-posix: work with glibc 2.13
authorEric Blake <eblake@redhat.com>
Fri, 21 Jan 2011 15:48:39 +0000 (08:48 -0700)
committerEric Blake <eblake@redhat.com>
Fri, 21 Jan 2011 15:48:39 +0000 (08:48 -0700)
* lib/strerror_r.c (strerror_r): Fix return type.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/strerror_r.c

index bdfb318..21a0936 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-01-21  Eric Blake  <eblake@redhat.com>
+
+       strerror_r-posix: work with glibc 2.13
+       * lib/strerror_r.c (strerror_r): Fix return type.
+
 2011-01-21  Pádraig Brady  <P@draigBrady.com>
             Bruno Haible  <bruno@clisp.org>
 
index 0cc0288..57a7e8f 100644 (file)
@@ -98,7 +98,7 @@ strerror_r (int errnum, char *buf, size_t buflen)
   extern int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
 
   int ret = __xpg_strerror_r (errnum, buf, buflen);
-  return (ret < 0 ? errno : 0);
+  return (ret < 0 ? errno : ret);
 }
 
 #else /* (__GLIBC__ >= 2 || defined __UCLIBC__ ? !HAVE___XPG_STRERROR_R : !HAVE_DECL_STRERROR_R) || EXTEND_STRERROR_R */