summaryrefslogtreecommitdiff
path: root/source4/lib/events/events_epoll.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/lib/events/events_epoll.c')
-rw-r--r--source4/lib/events/events_epoll.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/lib/events/events_epoll.c b/source4/lib/events/events_epoll.c
index f69b5bc6f4..efcbb97f0b 100644
--- a/source4/lib/events/events_epoll.c
+++ b/source4/lib/events/events_epoll.c
@@ -214,8 +214,19 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
timeout = ((tvalp->tv_usec+999) / 1000) + (tvalp->tv_sec*1000);
}
+ if (epoll_ev->ev->num_signal_handlers &&
+ common_event_check_signal(epoll_ev->ev)) {
+ return 0;
+ }
+
ret = epoll_wait(epoll_ev->epoll_fd, events, MAXEVENTS, timeout);
+ if (ret == -1 && errno == EINTR && epoll_ev->ev->num_signal_handlers) {
+ if (common_event_check_signal(epoll_ev->ev)) {
+ return 0;
+ }
+ }
+
if (ret == -1 && errno != EINTR) {
epoll_fallback_to_select(epoll_ev, "epoll_wait() failed");
return -1;
@@ -397,6 +408,7 @@ static const struct event_ops epoll_event_ops = {
.get_fd_flags = epoll_event_get_fd_flags,
.set_fd_flags = epoll_event_set_fd_flags,
.add_timed = common_event_add_timed,
+ .add_signal = common_event_add_signal,
.loop_once = epoll_event_loop_once,
.loop_wait = epoll_event_loop_wait,
};