summaryrefslogtreecommitdiff
path: root/lib/strerror_r.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2011-05-19 21:59:46 +0200
committerBruno Haible <bruno@clisp.org>2011-05-19 21:59:46 +0200
commite18f296f3ec35d260b38eca33621224dc674fd3d (patch)
tree38fb54d92e9975af7807b7ca1206502f1fe9f7d9 /lib/strerror_r.c
parent30f176b6e12f1a67070991ee7ac505f2fa8a605c (diff)
downloadgnulib-e18f296f3ec35d260b38eca33621224dc674fd3d.tar.gz
strerror_r: Reorder #if blocks.
* lib/strerror_r.c (strerror_r): Reorder conditionals in the function for consistency with the previous commit.
Diffstat (limited to 'lib/strerror_r.c')
-rw-r--r--lib/strerror_r.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/strerror_r.c b/lib/strerror_r.c
index fe1185ba4e..db48245106 100644
--- a/lib/strerror_r.c
+++ b/lib/strerror_r.c
@@ -419,7 +419,17 @@ strerror_r (int errnum, char *buf, size_t buflen)
{
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;
@@ -495,16 +505,6 @@ strerror_r (int errnum, char *buf, size_t buflen)
}
}
-#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