Mercurial > hg > octave-kai > gnulib-hg
changeset 14768:a12deda870d9
strerror_r: Reorder #if blocks.
* lib/strerror_r.c (strerror_r): Reorder conditionals in the function
for consistency with the previous commit.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Thu, 19 May 2011 21:59:46 +0200 |
parents | ff7953936223 |
children | 8e815ef27998 |
files | ChangeLog lib/strerror_r.c |
diffstat | 2 files changed, 18 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. @@ -13,7 +19,7 @@ 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>
--- a/lib/strerror_r.c +++ b/lib/strerror_r.c @@ -419,7 +419,17 @@ { 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 @@ } } -#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