diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-01-21 08:23:14 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:43:54 -0500 |
commit | 336ae458e9f648625f8fe438bf1dc4c8f7e616a7 (patch) | |
tree | dd7ead16ed385381a13046a85f2ff2a431465480 /source4/lib/events/events_aio.c | |
parent | 7fba2dbf9a7b387fb5a975b528d880da55da1560 (diff) | |
download | samba-336ae458e9f648625f8fe438bf1dc4c8f7e616a7.tar.gz samba-336ae458e9f648625f8fe438bf1dc4c8f7e616a7.tar.bz2 samba-336ae458e9f648625f8fe438bf1dc4c8f7e616a7.zip |
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)
Diffstat (limited to 'source4/lib/events/events_aio.c')
-rw-r--r-- | source4/lib/events/events_aio.c | 10 |
1 files changed, 10 insertions, 0 deletions
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, }; |