Skip to content
Snippets Groups Projects
Commit fe866d99 authored by Paul Sokolovsky's avatar Paul Sokolovsky
Browse files

unix/moduselect: Properly implement ipoll object iteration.

TODO: There's another issue to care about: poll set being modified during
iteration.
parent 3ab6aa3a
No related branches found
No related tags found
No related merge requests found
...@@ -253,8 +253,9 @@ STATIC mp_obj_t poll_iternext(mp_obj_t self_in) { ...@@ -253,8 +253,9 @@ STATIC mp_obj_t poll_iternext(mp_obj_t self_in) {
self->iter_cnt--; 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++) { for (int i = self->iter_idx; i < self->len; i++, entries++) {
self->iter_idx++;
if (entries->revents != 0) { if (entries->revents != 0) {
mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->ret_tuple); mp_obj_tuple_t *t = MP_OBJ_TO_PTR(self->ret_tuple);
// If there's an object stored, return it, otherwise raw fd // If there's an object stored, return it, otherwise raw fd
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment