summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-01-24 21:25:05 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-24 21:25:06 +0000
commit59936a3b51474fc3216659f089ff6543ac31ab4e (patch)
tree67156569bf455a9eb3fd18e0151e8e67dfed309c /libc
parent31005ca4c8562f3e6dfbed079eeaff8361ff8cdc (diff)
parente6bb5a27769cc974c4c6c1bfc96dcd07f0c0f5ef (diff)
downloadbionic-59936a3b51474fc3216659f089ff6543ac31ab4e.zip
bionic-59936a3b51474fc3216659f089ff6543ac31ab4e.tar.gz
bionic-59936a3b51474fc3216659f089ff6543ac31ab4e.tar.bz2
Merge "Fix optimized fread."
Diffstat (limited to 'libc')
-rw-r--r--libc/stdio/fread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/stdio/fread.c b/libc/stdio/fread.c
index baf62b9..bac8dad 100644
--- a/libc/stdio/fread.c
+++ b/libc/stdio/fread.c
@@ -120,7 +120,7 @@ fread(void *buf, size_t size, size_t count, FILE *fp)
while (total > 0) {
ssize_t bytes_read = (*fp->_read)(fp->_cookie, dst, total);
if (bytes_read <= 0) {
- fp->_flags = (fp->_r == 0) ? __SEOF : __SERR;
+ fp->_flags |= (bytes_read == 0) ? __SEOF : __SERR;
break;
}
dst += bytes_read;