Skip to content

Commit 9854371

Browse files
committed
EV timeout on kevent
1 parent 09362ee commit 9854371

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ static int ev_api_poll(struct ev_ctx *ctx, time_t timeout)
535535
{
536536
struct kqueue_api *k_api = ctx->api;
537537
struct timespec ts_timeout;
538-
ts_timeout.tv_sec = timeout;
538+
ts_timeout.tv_sec = timeout < 0 ? 0 : timeout;
539539
ts_timeout.tv_nsec = 0;
540540
int err =
541541
kevent(k_api->fd, NULL, 0, k_api->events, ctx->maxevents, &ts_timeout);

0 commit comments

Comments
 (0)