Don't check ferror(fp) when reading fp.
If feof(fp) or ferror(fp) was set, then our libc returned EOF for all later reads without trying to read. Our libc now behaves like BSD (and probably Illumos and musl) by checking only feof(fp). For difference, glibc doesn't check feof(fp). I described the difference between our libc and BSD libc in https://sourceforge.net/p/tack/mailman/message/35430300/
This commit is contained in:
parent
54028e403e
commit
75ae957c75
|
@ -16,7 +16,7 @@ __fillbuf(register FILE *stream)
|
|||
|
||||
stream->_count = 0;
|
||||
if (fileno(stream) < 0) return EOF;
|
||||
if (io_testflag(stream, (_IOEOF | _IOERR ))) return EOF;
|
||||
if (io_testflag(stream, _IOEOF)) return EOF;
|
||||
if (!io_testflag(stream, _IOREAD)) {
|
||||
stream->_flags |= _IOERR;
|
||||
return EOF;
|
||||
|
|
Loading…
Reference in a new issue