Commit d327f9de authored by Victor Stinner's avatar Victor Stinner

Issue #14180: Fix select.select() compilation on BSD and a typo in kqueue_queue_control()

parent 3a31dd40
...@@ -223,8 +223,10 @@ select_select(PyObject *self, PyObject *args) ...@@ -223,8 +223,10 @@ select_select(PyObject *self, PyObject *args)
return NULL; return NULL;
} }
else { else {
if (_PyTime_ObjectToTimeval(tout, &tv.tv_sec, &tv.tv_usec) == -1) long usec;
if (_PyTime_ObjectToTimeval(tout, &tv.tv_sec, &usec) == -1)
return NULL; return NULL;
tv.tv_usec = usec;
if (tv.tv_sec < 0) { if (tv.tv_sec < 0) {
PyErr_SetString(PyExc_ValueError, "timeout must be non-negative"); PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
return NULL; return NULL;
...@@ -1837,7 +1839,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args) ...@@ -1837,7 +1839,7 @@ kqueue_queue_control(kqueue_queue_Object *self, PyObject *args)
PyObject *result = NULL; PyObject *result = NULL;
struct kevent *evl = NULL; struct kevent *evl = NULL;
struct kevent *chl = NULL; struct kevent *chl = NULL;
struct timespec timeoutspec; struct timespec timeout;
struct timespec *ptimeoutspec; struct timespec *ptimeoutspec;
if (self->kqfd < 0) if (self->kqfd < 0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment