From 336ae458e9f648625f8fe438bf1dc4c8f7e616a7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 21 Jan 2007 08:23:14 +0000 Subject: r20928: added signal events to lib/events Jeremy asked for this to allow Samba3 to use the Samba4 events library see torture/local/event.c for an example (This used to be commit 7e105482ff9a3da6b4708ff99a64f1881614fc5f) --- source4/lib/events/events_aio.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/lib/events/events_aio.c') diff --git a/source4/lib/events/events_aio.c b/source4/lib/events/events_aio.c index 6d9dd6d753..327b36bcba 100644 --- a/source4/lib/events/events_aio.c +++ b/source4/lib/events/events_aio.c @@ -225,6 +225,11 @@ static int aio_event_loop(struct aio_event_context *aio_ev, struct timeval *tval if (aio_ev->epoll_fd == -1) return -1; + if (aio_ev->ev->num_signal_handlers && + common_event_check_signal(aio_ev->ev)) { + return 0; + } + if (tvalp) { timeout.tv_sec = tvalp->tv_sec; timeout.tv_nsec = tvalp->tv_usec; @@ -236,7 +241,11 @@ static int aio_event_loop(struct aio_event_context *aio_ev, struct timeval *tval ret = io_getevents(aio_ev->ioctx, 1, 8, events, tvalp?&timeout:NULL); + if (ret == -EINTR) { + if (aio_ev->ev->num_signal_handlers) { + common_event_check_signal(aio_ev->ev); + } return 0; } @@ -488,6 +497,7 @@ static const struct event_ops aio_event_ops = { .get_fd_flags = aio_event_get_fd_flags, .set_fd_flags = aio_event_set_fd_flags, .add_timed = common_event_add_timed, + .add_signal = common_event_add_signal, .loop_once = aio_event_loop_once, .loop_wait = aio_event_loop_wait, }; -- cgit