unix/moduselect: Properly implement ipoll object iteration.

TODO: There's another issue to care about: poll set being modified during
iteration.
pull/1/head
Paul Sokolovsky 2017-03-05 13:51:22 +01:00
parent 3ab6aa3a6d
commit fe866d996f
1 changed files with 2 additions and 1 deletions

View File

@ -253,8 +253,9 @@ STATIC mp_obj_t poll_iternext(mp_obj_t self_in) {
self->iter_cnt--;
struct pollfd *entries = self->entries;
struct pollfd *entries = self->entries + self->iter_idx;
for (int i = self->iter_idx; i < self->len; i++, entries++) {
self->iter_idx++;
if (entries->revents != 0) {
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->ret_tuple);
// If there's an object stored, return it, otherwise raw fd