From 3f498bf72b7dea1dfc10e65cc688301e07382031 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Tue, 23 Oct 2001 23:52:11 +0000 Subject: [PATCH] Back out read buffer invalidating via __SMOD. It was correct, but not needed because internal buffer cleared on each seek outside of it. --- lib/libc/stdio/fseek.c | 4 ++-- lib/libc/stdio/stdio.c | 5 ----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/lib/libc/stdio/fseek.c b/lib/libc/stdio/fseek.c index b8366f33d52..2278f311ea9 100644 --- a/lib/libc/stdio/fseek.c +++ b/lib/libc/stdio/fseek.c @@ -225,8 +225,8 @@ _fseeko(fp, offset, whence, ltest) goto dumb; /* - * If the buffer was modified or the file position was changed, - * we have to skip this; see fgetln.c, stdio.c. + * (If the buffer was modified, we have to + * skip this; see fgetln.c.) */ if (fp->_flags & __SMOD) goto abspos; diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c index c0860ebaded..4bee60804d4 100644 --- a/lib/libc/stdio/stdio.c +++ b/lib/libc/stdio/stdio.c @@ -164,11 +164,6 @@ _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