diff options
Diffstat (limited to 'src/mainloop.c')
-rw-r--r-- | src/mainloop.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mainloop.c b/src/mainloop.c index 0f5811f2..2992673a 100644 --- a/src/mainloop.c +++ b/src/mainloop.c @@ -248,8 +248,10 @@ int mainloop_iterate(struct mainloop *m, int block) { } } - if (m->rebuild_pollfds) + if (m->rebuild_pollfds) { rebuild_pollfds(m); + m->rebuild_pollfds = 0; + } m->running = 1; @@ -431,7 +433,7 @@ void mainloop_source_enable(struct mainloop_source*s, int b) { void mainloop_source_io_set_events(struct mainloop_source*s, enum mainloop_io_event events) { assert(s && !s->dead && s->type == MAINLOOP_SOURCE_TYPE_IO); - if ((s->io.events && !events) || (!s->io.events && events)) { + if (s->io.events != events) { assert(s->mainloop); s->mainloop->rebuild_pollfds = 1; } |