unix/moduselect: Properly implement ipoll object iteration.
TODO: There's another issue to care about: poll set being modified during iteration.
This commit is contained in:
parent
3ab6aa3a6d
commit
fe866d996f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user