diff options
| author | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
|---|---|---|
| committer | svn2git <svn2git@FreeBSD.org> | 1994-05-01 08:00:00 +0000 |
| commit | a16f65c7d117419bd266c28a1901ef129a337569 (patch) | |
| tree | 2626602f66dc3551e7a7c7bc9ad763c3bc7ab40a /lib/libc/stdio/setvbuf.c | |
| parent | 8503f4f13f77abf7adc8f7e329c6f9c1d52b6a20 (diff) | |
Diffstat (limited to 'lib/libc/stdio/setvbuf.c')
| -rw-r--r-- | lib/libc/stdio/setvbuf.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdio/setvbuf.c b/lib/libc/stdio/setvbuf.c index 1928ae14160b..78e616387269 100644 --- a/lib/libc/stdio/setvbuf.c +++ b/lib/libc/stdio/setvbuf.c @@ -137,11 +137,14 @@ nbf: flags |= __SLBF; if (flags & __SRW) flags &= ~(__SRD | __SWR); - fp->_w = 0; fp->_flags = flags; fp->_bf._base = fp->_p = (unsigned char *)buf; fp->_bf._size = size; fp->_lbfsize = 0; + if (flags & __SWR) + __swsetup(fp); + else + fp->_w = 0; __cleanup = _cleanup; return (ret); |
