if (evsignal_deliver(&devpollop->evsigmask) == -1)
return (-1);
- timeout = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+ timeout = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
dvp.dp_fds = devpollop->events;
dvp.dp_nfds = devpollop->nevents;
if (evsignal_deliver(&epollop->evsigmask) == -1)
return (-1);
- timeout = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+ timeout = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
res = epoll_wait(epollop->epfd, events, epollop->nevents, timeout);
if (evsignal_recalc(&epollop->evsigmask) == -1)
if (evsignal_deliver(&pop->evsigmask) == -1)
return (-1);
- sec = tv->tv_sec * 1000 + tv->tv_usec / 1000;
+ sec = tv->tv_sec * 1000 + (tv->tv_usec + 999) / 1000;
res = poll(pop->event_set, nfds, sec);
if (evsignal_recalc(&pop->evsigmask) == -1)
if (!op->cur)
return (0);
- res = poll(op->poll, op->cur, tv->tv_sec * 1000 + tv->tv_usec / 1000);
+ res = poll(op->poll, op->cur, tv->tv_sec * 1000 +
+ (tv->tv_usec + 999) / 1000);
if (res < 0)
return (-1);