struct timeval tv;
int res, done;
- /* Calculate the initial events that we are waiting for */
- if (evsel->recalc(base, evbase, 0) == -1)
- return (-1);
-
done = 0;
while (!done) {
+ /* Calculate the initial events that we are waiting for */
+ if (evsel->recalc(base, evbase, 0) == -1)
+ return (-1);
+
/* Terminate the loop if we have been asked to */
if (base->event_gotterm) {
base->event_gotterm = 0;
done = 1;
} else if (flags & EVLOOP_NONBLOCK)
done = 1;
-
- if (evsel->recalc(base, evbase, 0) == -1)
- return (-1);
}
event_debug(("%s: asked to terminate loop.", __func__));