summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index ffaf865..ef53067 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1013,7 +1013,6 @@ newDevPollObject(void)
struct pollfd *fds;
struct rlimit limit;
- Py_BEGIN_ALLOW_THREADS
/*
** If we try to process more that getrlimit()
** fds, the kernel will give an error, so
@@ -1021,18 +1020,14 @@ newDevPollObject(void)
** value, because we can change rlimit() anytime.
*/
limit_result = getrlimit(RLIMIT_NOFILE, &limit);
- if (limit_result != -1)
- fd_devpoll = _Py_open("/dev/poll", O_RDWR);
- Py_END_ALLOW_THREADS
-
if (limit_result == -1) {
PyErr_SetFromErrno(PyExc_OSError);
return NULL;
}
- if (fd_devpoll == -1) {
- PyErr_SetFromErrnoWithFilename(PyExc_IOError, "/dev/poll");
+
+ fd_devpoll = _Py_open("/dev/poll", O_RDWR);
+ if (fd_devpoll == -1)
return NULL;
- }
fds = PyMem_NEW(struct pollfd, limit.rlim_cur);
if (fds == NULL) {