diff options
author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-12-19 09:50:10 +0000 |
---|---|---|
committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-12-19 09:50:10 +0000 |
commit | a207a8e3f157060bb6dcc338b895da3b44bfad85 (patch) | |
tree | 0660e6ab0f351dc3799b487900503a75ef0786f3 | |
parent | a932a3f4b561c7ece31af195f5455b7c7d989140 (diff) |
Notes
-rw-r--r-- | lib/libc/stdio/perror.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdio/perror.c b/lib/libc/stdio/perror.c index 226c1897bf8c..162d49e56d1c 100644 --- a/lib/libc/stdio/perror.c +++ b/lib/libc/stdio/perror.c @@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$"); #include <sys/uio.h> #include <unistd.h> #include <errno.h> +#include <limits.h> #include <stdio.h> #include <string.h> #include "un-namespace.h" @@ -50,6 +51,7 @@ void perror(s) const char *s; { + char msgbuf[NL_TEXTMAX]; struct iovec *v; struct iovec iov[4]; @@ -62,7 +64,8 @@ perror(s) v->iov_len = 2; v++; } - v->iov_base = strerror(errno); + strerror_r(errno, msgbuf, sizeof(msgbuf)); + v->iov_base = msgbuf; v->iov_len = strlen(v->iov_base); v++; v->iov_base = "\n"; |