summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-19 22:33:09 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-03-19 22:33:09 (GMT)
commit54799672dad9e6a10adde0f4af87d9f8165e4d7a (patch)
treef3396b8c4313ff3f5d3c24f76311eb5382ee4e97 /Modules/selectmodule.c
parentc7cd12da6062e19625cfef38aa25ed58a6109fa1 (diff)
downloadcpython-54799672dad9e6a10adde0f4af87d9f8165e4d7a.zip
cpython-54799672dad9e6a10adde0f4af87d9f8165e4d7a.tar.gz
cpython-54799672dad9e6a10adde0f4af87d9f8165e4d7a.tar.bz2
Issue #23708: select.devpoll now retries its internal write() when interrupted
by a signal (EINTR). Modify devpoll_flush() to use _Py_write() instead of calling directly write().
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index ef53067..a65af2f 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -718,14 +718,10 @@ static int devpoll_flush(devpollObject *self)
size = sizeof(struct pollfd)*self->n_fds;
self->n_fds = 0;
- Py_BEGIN_ALLOW_THREADS
- n = write(self->fd_devpoll, self->fds, size);
- Py_END_ALLOW_THREADS
-
- if (n == -1 ) {
- PyErr_SetFromErrno(PyExc_IOError);
+ n = _Py_write(self->fd_devpoll, self->fds, size);
+ if (n == -1)
return -1;
- }
+
if (n < size) {
/*
** Data writed to /dev/poll is a binary data structure. It is not