summaryrefslogtreecommitdiffstats
path: root/Modules/selectmodule.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-12-27 22:01:21 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-12-27 22:01:21 (GMT)
commit83251c1ecd244dec4606a194c95f90463c73f6e4 (patch)
tree6ba7e580e88d0e6a780c4749413e7e063846c5f4 /Modules/selectmodule.c
parent95c16629d3549e7306d297ed09e26e58b151f720 (diff)
downloadcpython-83251c1ecd244dec4606a194c95f90463c73f6e4.zip
cpython-83251c1ecd244dec4606a194c95f90463c73f6e4.tar.gz
cpython-83251c1ecd244dec4606a194c95f90463c73f6e4.tar.bz2
try to always use the old API
Diffstat (limited to 'Modules/selectmodule.c')
-rw-r--r--Modules/selectmodule.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Modules/selectmodule.c b/Modules/selectmodule.c
index a8413fe..945055f 100644
--- a/Modules/selectmodule.c
+++ b/Modules/selectmodule.c
@@ -1099,10 +1099,11 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
if (fd == -1) {
Py_BEGIN_ALLOW_THREADS
#ifdef HAVE_EPOLL_CREATE1
- self->epfd = epoll_create1(flags);
-#else
- self->epfd = epoll_create(sizehint);
+ if (flags)
+ self->epfd = epoll_create1(flags);
+ else
#endif
+ self->epfd = epoll_create(sizehint);
Py_END_ALLOW_THREADS
}
else {
@@ -1120,7 +1121,7 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd)
static PyObject *
pyepoll_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
- int flags = 0, sizehint = 0;
+ int flags = 0, sizehint = FD_SETSIZE - 1;
static char *kwlist[] = {"sizehint", "flags", NULL};
if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:epoll", kwlist,