+2011-05-19 Bruno Haible <bruno@clisp.org>
+
+ strerror_r: Reorder #if blocks.
+ * lib/strerror_r.c (strerror_r): Reorder conditionals in the function
+ for consistency with the previous commit.
+
2011-05-19 Bruno Haible <bruno@clisp.org>
perror: Avoid clobbering the strerror buffer when possible.
2011-05-19 Eric Blake <eblake@redhat.com>
strerror_r: fix on newer cygwin
- * lib/strerror_r.c (rpl_strerror_r): Cygwin now has
+ * lib/strerror_r.c (strerror_r): Cygwin now has
__xpg_strerror_r, use it.
2011-05-19 Bruno Haible <bruno@clisp.org>
{
int ret;
-#if USE_SYSTEM_STRERROR_R
+#if USE_XPG_STRERROR_R
+
+ {
+ extern int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
+
+ ret = __xpg_strerror_r (errnum, buf, buflen);
+ if (ret < 0)
+ ret = errno;
+ }
+
+#elif USE_SYSTEM_STRERROR_R
if (buflen > INT_MAX)
buflen = INT_MAX;
}
}
-#elif USE_XPG_STRERROR_R
-
- {
- extern int __xpg_strerror_r (int errnum, char *buf, size_t buflen);
-
- ret = __xpg_strerror_r (errnum, buf, buflen);
- if (ret < 0)
- ret = errno;
- }
-
#else /* USE_SYSTEM_STRERROR */
/* Try to do what strerror (errnum) does, but without clobbering the