* can unlock it when it polls.
*/
EGC_GC;
- int rc;
+ int rc, nfds;
struct timeval now;
rc = libxl__gettimeofday(gc, &now);
int timeout;
for (;;) {
- int nfds = poller->fd_polls_allocd;
+ nfds = poller->fd_polls_allocd;
timeout = -1;
rc = beforepoll_internal(gc, poller, &nfds, poller->fd_polls,
&timeout, now);
}
CTX_UNLOCK;
- rc = poll(poller->fd_polls, poller->fd_polls_allocd, timeout);
+ rc = poll(poller->fd_polls, nfds, timeout);
CTX_LOCK;
if (rc < 0) {
rc = libxl__gettimeofday(gc, &now);
if (rc) goto out;
- afterpoll_internal(egc, poller,
- poller->fd_polls_allocd, poller->fd_polls, now);
+ afterpoll_internal(egc, poller, nfds, poller->fd_polls, now);
rc = 0;
out: