diff options
-rw-r--r-- | events.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -115,16 +115,17 @@ static void events_dispatch(struct events *events, const fd_set *rfds, const fd_set *wfds, const fd_set *efds) { struct event_fd *event; + struct event_fd *next; - list_for_each_entry(event, &events->events, list) { + list_for_each_entry_safe(event, next, &events->events, list) { if (event->type == OMAP3_ISP_EVENT_READ && FD_ISSET(event->fd, rfds)) event->callback(event->priv); - if (event->type == OMAP3_ISP_EVENT_WRITE && - FD_ISSET(event->fd, wfds)) + else if (event->type == OMAP3_ISP_EVENT_WRITE && + FD_ISSET(event->fd, wfds)) event->callback(event->priv); - if (event->type == OMAP3_ISP_EVENT_EXCEPTION && - FD_ISSET(event->fd, efds)) + else if (event->type == OMAP3_ISP_EVENT_EXCEPTION && + FD_ISSET(event->fd, efds)) event->callback(event->priv); /* If the callback stopped events processing, we're done. */ |