Browse Source

[core] poll: fdarray uses fd as index, not fde_ndx

personal/stbuehler/fix-fdevent
Stefan Bühler 2 years ago
parent
commit
9232145024
  1. 4
      src/fdevent_poll.c

4
src/fdevent_poll.c

@ -165,9 +165,9 @@ static int fdevent_poll_poll(fdevents *ev, int timeout_ms) {
fdnode *fdn;
ndx = fdevent_poll_event_next_fdndx(ev, ndx);
if (-1 == ndx) break;
fdn = ev->fdarray[ndx];
fdn = ev->fdarray[ev->pollfds[ndx].fd];
if (0 == ((uintptr_t)fdn & 0x3)) {
int revents = fdevent_poll_event_get_revent(ev, i);
int revents = fdevent_poll_event_get_revent(ev, ndx);
(*fdn->handler)(srv, fdn->ctx, revents);
}
}

Loading…
Cancel
Save