summaryrefslogtreecommitdiffstatshomepage
path: root/unix/moduselect.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-28 17:34:20 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-11-28 17:34:46 +0200
commit19920e25f99dcae0559c7fcc142bbebe239c1e0e (patch)
treefe3e8109c67978647217848b9ab31bb886459374 /unix/moduselect.c
parent0786716c5a9b352f24bb3e3386515ae3298942e7 (diff)
downloadmicropython-19920e25f99dcae0559c7fcc142bbebe239c1e0e.tar.gz
micropython-19920e25f99dcae0559c7fcc142bbebe239c1e0e.zip
unix/moduselect: Fix bug in poll.poll() scanning loop.
Diffstat (limited to 'unix/moduselect.c')
-rw-r--r--unix/moduselect.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/unix/moduselect.c b/unix/moduselect.c
index 0815513df2..645e0545d4 100644
--- a/unix/moduselect.c
+++ b/unix/moduselect.c
@@ -130,13 +130,12 @@ STATIC mp_obj_t poll_poll(uint n_args, const mp_obj_t *args) {
mp_obj_list_t *ret_list = mp_obj_new_list(n_ready, NULL);
int ret_i = 0;
struct pollfd *entries = self->entries;
- for (int i = 0; i < self->len; i++) {
+ for (int i = 0; i < self->len; i++, entries++) {
if (entries->revents != 0) {
mp_obj_tuple_t *t = mp_obj_new_tuple(2, NULL);
t->items[0] = MP_OBJ_NEW_SMALL_INT(entries->fd);
t->items[1] = MP_OBJ_NEW_SMALL_INT(entries->revents);
ret_list->items[ret_i++] = t;
- entries++;
}
}