diff options
author | Eric Blake <eblake@redhat.com> | 2011-05-25 18:41:10 +0000 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2011-05-25 18:41:10 +0000 |
commit | 4805b60ccfeee32a4ac3547e680c917f9e5c1d39 (patch) | |
tree | 7035ae20768510551b6abb65549b1e51acd18e09 /newlib/libc/stdio/perror.c | |
parent | 6215837523703c2c0b58200341ae3861d8b7a28d (diff) | |
download | cygnal-4805b60ccfeee32a4ac3547e680c917f9e5c1d39.tar.gz cygnal-4805b60ccfeee32a4ac3547e680c917f9e5c1d39.tar.bz2 cygnal-4805b60ccfeee32a4ac3547e680c917f9e5c1d39.zip |
strerror: allow user hook to comply with POSIX rules
* libc/string/strerror.c (strerror): Split body into...
(_strerror_r): ...new reentrant function.
* libc/string/u_strerr.c (_user_strerror): Update signature.
* libc/include/stdio.h (_strerror_r): New prototype.
* libc/posix/collate.c (__collate_err): Adjust callers.
* libc/stdio/perror.c (_perror_r): Likewise.
* libc/string/strerror_r.c (strerror_r): Likewise.
* libc/string/xpg_strerror_r.c (__xpg_strerror_r): Likewise.
Diffstat (limited to 'newlib/libc/stdio/perror.c')
-rw-r--r-- | newlib/libc/stdio/perror.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/stdio/perror.c b/newlib/libc/stdio/perror.c index 5dbf3326c..14b4d2173 100644 --- a/newlib/libc/stdio/perror.c +++ b/newlib/libc/stdio/perror.c @@ -73,6 +73,7 @@ _DEFUN(_perror_r, (ptr, s), _CONST char *s) { char *error; + int dummy; _REENT_SMALL_CHECK_INIT (ptr); if (s != NULL && *s != '\0') @@ -81,7 +82,7 @@ _DEFUN(_perror_r, (ptr, s), fputs (": ", _stderr_r (ptr)); } - if ((error = strerror (ptr->_errno)) != NULL) + if ((error = _strerror_r (ptr, ptr->_errno, 1, &dummy)) != NULL) fputs (error, _stderr_r (ptr)); fputc ('\n', _stderr_r (ptr)); |