Skip to content

Commit

Permalink
fix dangling if to shutup compiler warning
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasan Alayli committed Jun 17, 2015
1 parent 571e56c commit 21e3cf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lthread_poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ _lthread_poller_set_fd_ready(struct lthread *lt, int fd, enum lthread_event e,
* deschedule them all and cancel events in poller so they don't trigger later.
*/
int i;
if (lt->ready_fds == 0)
if (lt->ready_fds == 0) {
for (i = 0; i < lt->nfds; i++)
if (lt->pollfds[i].events & POLLIN) {
_lthread_poller_ev_clear_rd(lt->pollfds[i].fd);
Expand All @@ -53,6 +53,7 @@ _lthread_poller_set_fd_ready(struct lthread *lt, int fd, enum lthread_event e,
_lthread_poller_ev_clear_wr(lt->pollfds[i].fd);
_lthread_desched_event(lt->pollfds[i].fd, LT_EV_WRITE);
}
}


lt->pollfds[lt->ready_fds].fd = fd;
Expand Down

0 comments on commit 21e3cf3

Please sign in to comment.