Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-05-25 22:41:10 +0400
committerEric Blake <eblake@redhat.com>2011-05-25 22:41:10 +0400
commit4805b60ccfeee32a4ac3547e680c917f9e5c1d39 (patch)
tree7035ae20768510551b6abb65549b1e51acd18e09 /newlib/libc/posix
parent6215837523703c2c0b58200341ae3861d8b7a28d (diff)
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/posix')
-rw-r--r--newlib/libc/posix/collate.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/posix/collate.c b/newlib/libc/posix/collate.c
index 8af8970c9..6ee455001 100644
--- a/newlib/libc/posix/collate.c
+++ b/newlib/libc/posix/collate.c
@@ -177,12 +177,13 @@ __collate_err(int ex, const char *f)
{
const char *s;
int serrno = errno;
+ int dummy;
/* Be careful to change write counts if you change the strings */
write(STDERR_FILENO, "collate_error: ", 15);
write(STDERR_FILENO, f, strlen(f));
write(STDERR_FILENO, ": ", 2);
- s = strerror(serrno);
+ s = _strerror_r(_REENT, serrno, 1, &dummy);
write(STDERR_FILENO, s, strlen(s));
write(STDERR_FILENO, "\n", 1);
exit(ex);