diff options
author | Gregory P. Smith <greg@krypto.org> | 2012-06-24 06:55:39 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@krypto.org> | 2012-06-24 06:55:39 (GMT) |
commit | 5135992164f4c0df8d18d3b486431b28214db16b (patch) | |
tree | 7bc3060d22ad740bf2bf795caae1c6a46232f6e7 /Modules/_io/bufferedio.c | |
parent | 8150492f11f17e2a09f7deb7af706536bc326c98 (diff) | |
download | cpython-5135992164f4c0df8d18d3b486431b28214db16b.zip cpython-5135992164f4c0df8d18d3b486431b28214db16b.tar.gz cpython-5135992164f4c0df8d18d3b486431b28214db16b.tar.bz2 |
Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
Diffstat (limited to 'Modules/_io/bufferedio.c')
-rw-r--r-- | Modules/_io/bufferedio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Modules/_io/bufferedio.c b/Modules/_io/bufferedio.c index 4c43c69..21e6b36 100644 --- a/Modules/_io/bufferedio.c +++ b/Modules/_io/bufferedio.c @@ -730,8 +730,8 @@ _buffered_init(buffered *self) clears the error indicator), 0 otherwise. Should only be called when PyErr_Occurred() is true. */ -static int -_trap_eintr(void) +int +_PyIO_trap_eintr(void) { static PyObject *eintr_int = NULL; PyObject *typ, *val, *tb; @@ -1314,7 +1314,7 @@ _bufferedreader_raw_read(buffered *self, char *start, Py_ssize_t len) */ do { res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_readinto, memobj, NULL); - } while (res == NULL && _trap_eintr()); + } while (res == NULL && _PyIO_trap_eintr()); Py_DECREF(memobj); if (res == NULL) return -1; @@ -1742,7 +1742,7 @@ _bufferedwriter_raw_write(buffered *self, char *start, Py_ssize_t len) errno = 0; res = PyObject_CallMethodObjArgs(self->raw, _PyIO_str_write, memobj, NULL); errnum = errno; - } while (res == NULL && _trap_eintr()); + } while (res == NULL && _PyIO_trap_eintr()); Py_DECREF(memobj); if (res == NULL) return -1; |