diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-12-19 09:53:26 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-12-19 09:53:26 +0000 |
| commit | 37d2356335dc49410c518879de3bef3c5cf298ec (patch) | |
| tree | bc7f0601bf214c5e63115618af3226ea6224f612 /lib/libc | |
| parent | a207a8e3f157060bb6dcc338b895da3b44bfad85 (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/stdio/perror.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/libc/stdio/perror.c b/lib/libc/stdio/perror.c index 162d49e56d1cf..29016f742444f 100644 --- a/lib/libc/stdio/perror.c +++ b/lib/libc/stdio/perror.c @@ -46,6 +46,8 @@ __FBSDID("$FreeBSD$"); #include <stdio.h> #include <string.h> #include "un-namespace.h" +#include "libc_private.h" +#include "local.h" void perror(s) @@ -70,5 +72,9 @@ perror(s) v++; v->iov_base = "\n"; v->iov_len = 1; - (void)_writev(STDERR_FILENO, iov, (v - iov) + 1); + FLOCKFILE(stderr); + __sflush(stderr); + (void)_writev(stderr->_file, iov, (v - iov) + 1); + stderr->_flags &= ~__SOFF; + FUNLOCKFILE(stderr); } |
