diff options
Diffstat (limited to 'libc/stdio/fread.c')
-rw-r--r-- | libc/stdio/fread.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libc/stdio/fread.c b/libc/stdio/fread.c index bac8dad66..f3f012737 100644 --- a/libc/stdio/fread.c +++ b/libc/stdio/fread.c @@ -102,6 +102,12 @@ fread(void *buf, size_t size, size_t count, FILE *fp) * avoid copying it through the buffer? */ if (total > (size_t) fp->_bf._size) { + /* + * Make sure that fseek doesn't think it can + * reuse the buffer since we are going to read + * directly from the file descriptor. + */ + fp->_flags |= __SMOD; break; } |