Skip to content

Commit

Permalink
Use loop->running instead of a new variable
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Nov 11, 2018
1 parent 5d20b35 commit ecc483a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions event-loop.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,9 @@ int run_event_loop(struct mako_event_loop *loop) {
break;
}

bool stop = false;
for (size_t i = 0; i < MAKO_EVENT_COUNT; ++i) {
if (loop->fds[i].revents & POLLHUP) {
stop = true;
loop->running = false;
break;
}
if (loop->fds[i].revents & POLLERR) {
Expand All @@ -209,7 +208,7 @@ int run_event_loop(struct mako_event_loop *loop) {
break;
}
}
if (stop || ret < 0) {
if (!loop->running || ret < 0) {
break;
}

Expand Down

0 comments on commit ecc483a

Please # to comment.