diff --git a/c/unix/event.c b/c/unix/event.c index 1dd3271..9d98ccf 100644 --- a/c/unix/event.c +++ b/c/unix/event.c @@ -625,11 +625,10 @@ queue_ready_ports(bool wait, long seconds, long ticks) tvp = &tv; if (wait) if (seconds == -1){ - tv.tv_sec = 1; - tv.tv_usec = 0; + tvp = NULL; } else { - tv.tv_sec = (seconds > 0) ? 1 : 0; + tv.tv_sec = seconds; tv.tv_usec = ticks * (1000000 / TICKS_PER_SECOND); } else @@ -654,18 +653,6 @@ queue_ready_ports(bool wait, long seconds, long ticks) poll_time = -1; return NO_ERRORS; } - else if (wait && (left == 0) && (limfd == 0)){ - if (seconds > 1){ - seconds--; - tv.tv_sec = 1; /* select maybe destroyed tv */ - tv.tv_usec = 0; /* we already waited the usecs */ - } - else if (seconds > -1) return NO_ERRORS; - else { /* loop if seconds == -1 */ - tv.tv_sec = 1; - tv.tv_usec = 0; - } - } else if (left == 0) return NO_ERRORS; else if (errno == EINTR) {