Browse Source

unix/moduselect: Properly implement ipoll object iteration.

TODO: There's another issue to care about: poll set being modified during
iteration.
pull/2918/head
Paul Sokolovsky 8 years ago
parent
commit
fe866d996f
  1. 3
      unix/moduselect.c

3
unix/moduselect.c

@ -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…
Cancel
Save