diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 2001-10-23 22:48:00 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 2001-10-23 22:48:00 +0000 |
| commit | 751fc77994897c98526afeeab200b22c4555467a (patch) | |
| tree | 30016a89c87946740b5bc95f59bf9ed664cccc5a /lib/libc/stdio/stdio.c | |
| parent | 9965784733284cbfe1e0a41f2359395dc4320c7d (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdio/stdio.c')
| -rw-r--r-- | lib/libc/stdio/stdio.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c index 4bee60804d4a..c0860ebaded2 100644 --- a/lib/libc/stdio/stdio.c +++ b/lib/libc/stdio/stdio.c @@ -164,6 +164,11 @@ _sseek(fp, offset, whence) errret = errno; if (errno == 0) errno = serrno; + + if (errret == 0 && (offset != 0 || whence != SEEK_CUR)) + /* Disallow fseek() optimization inside read buffer */ + fp->_flags |= __SMOD; + /* * Disallow negative seeks per POSIX. * It is needed here to help upper level caller |
