Disallow fseek() optimization in internal read buffer, if pointer is moved by
seek. It means that beginning of read buffer becomes not the same as current file position.
This commit is contained in:
parent
f9e1c31e42
commit
76a4ffc8e5
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user