diff --git a/io.c b/io.c index eb4b492..bb6d0e8 100644 --- a/io.c +++ b/io.c @@ -158,11 +158,10 @@ io_polln(struct io **iop, u_int n, struct io **rio, int timeout, char **cause) xfree(pfds); if (error == 0) { - if (timeout == 0) { + if (timeout == 0) errno = EAGAIN; - return (-1); - } - errno = ETIMEDOUT; + else + errno = ETIMEDOUT; } if (errno == EINTR)