commit | 3da3fcef961c4be22806d9d94df5f1d0f09dbbc7 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Thu Feb 19 20:46:48 1998 +0000 |
committer | Guido van Rossum <guido@python.org> | Thu Feb 19 20:46:48 1998 +0000 |
tree | f5812112443983852af87e6685e5103696c4f1e9 | |
parent | 9168328572fbb4c3369f3cb64370eeb970fd0728 [diff] |
Check ferror(), not errno, for fread() error.
diff --git a/Objects/fileobject.c b/Objects/fileobject.c index cd8a730..5502f15 100644 --- a/Objects/fileobject.c +++ b/Objects/fileobject.c
@@ -695,7 +695,7 @@ Py_END_ALLOW_THREADS if (nread == 0) { sizehint = 0; - if (nread == 0) + if (!ferror(f->f_fp)) break; PyErr_SetFromErrno(PyExc_IOError); clearerr(f->f_fp);