| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1099,10 +1099,11 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd) | |||
| 1099 | 1099 | if (fd == -1) { | |
| 1100 | 1100 | Py_BEGIN_ALLOW_THREADS | |
| 1101 | 1101 | #ifdef HAVE_EPOLL_CREATE1 | |
| 1102 | - self->epfd = epoll_create1(flags); | ||
| 1103 | - #else | ||
| 1104 | - self->epfd = epoll_create(sizehint); | ||
| 1102 | + if (flags) | ||
| 1103 | + self->epfd = epoll_create1(flags); | ||
| 1104 | + else | ||
| 1105 | 1105 | #endif | |
| 1106 | + self->epfd = epoll_create(sizehint); | ||
| 1106 | 1107 | Py_END_ALLOW_THREADS | |
| 1107 | 1108 | } | |
| 1108 | 1109 | else { | |
@@ -1120,7 +1121,7 @@ newPyEpoll_Object(PyTypeObject *type, int sizehint, int flags, SOCKET fd) | |||
| 1120 | 1121 | static PyObject * | |
| 1121 | 1122 | pyepoll_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |
| 1122 | 1123 | { | |
| 1123 | - int flags = 0, sizehint = 0; | ||
| 1124 | + int flags = 0, sizehint = FD_SETSIZE - 1; | ||
| 1124 | 1125 | static char *kwlist[] = {"sizehint", "flags", NULL}; | |
| 1125 | 1126 | ||
| 1126 | 1127 | if (!PyArg_ParseTupleAndKeywords(args, kwds, "|ii:epoll", kwlist, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments