return NULL;
}
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;
+ tv.tv_usec = usec;
if (tv.tv_sec < 0) {
PyErr_SetString(PyExc_ValueError, "timeout must be non-negative");
return NULL;
PyObject *result = NULL;
struct kevent *evl = NULL;
struct kevent *chl = NULL;
- struct timespec timeoutspec;
+ struct timespec timeout;
struct timespec *ptimeoutspec;
if (self->kqfd < 0)