s->io.revents = events;
- /*
- If this is a oneshot event source, then we added it to the
- epoll with EPOLLONESHOT, hence we know it's not registered
- anymore. We can save a syscall here...
- */
-
- if (s->enabled == SD_EVENT_ONESHOT)
- s->io.registered = false;
-
return source_set_pending(s, true);
}
}
static int source_dispatch(sd_event_source *s) {
- int r;
+ int r = 0;
assert(s);
assert(s->pending || s->type == SOURCE_QUIT);
m = epoll_wait(e->epoll_fd, ev_queue, EPOLL_QUEUE_MAX,
timeout == (uint64_t) -1 ? -1 : (int) ((timeout + USEC_PER_MSEC - 1) / USEC_PER_MSEC));
if (m < 0) {
- r = m;
+ r = errno == EAGAIN || errno == EINTR ? 0 : -errno;
goto finish;
}