summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-20 18:01:57 +0100
committerJeremy Allison <jra@samba.org>2013-03-01 12:01:09 -0800
commita347d55f506541e18b95cf3e7c1e83f2c665ee91 (patch)
treed3aaffffd2bd3c605e2ee4ee6923c41f95b74d5a /lib/tevent
parent6703c5b49ff8f1957a16b1bab5a0e0d18bf1af75 (diff)
downloadsamba-a347d55f506541e18b95cf3e7c1e83f2c665ee91.tar.gz
samba-a347d55f506541e18b95cf3e7c1e83f2c665ee91.tar.bz2
samba-a347d55f506541e18b95cf3e7c1e83f2c665ee91.zip
tevent: handle multiplexed fde's in epoll_event_fd_destructor()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/tevent_epoll.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c
index d8c1050701..b1927d3197 100644
--- a/lib/tevent/tevent_epoll.c
+++ b/lib/tevent/tevent_epoll.c
@@ -683,6 +683,7 @@ static int epoll_event_fd_destructor(struct tevent_fd *fde)
struct tevent_context *ev = fde->event_ctx;
struct epoll_event_context *epoll_ev = NULL;
bool panic_triggered = false;
+ struct tevent_fd *mpx_fde = NULL;
int flags = fde->flags;
if (ev == NULL) {
@@ -699,12 +700,32 @@ static int epoll_event_fd_destructor(struct tevent_fd *fde)
*/
DLIST_REMOVE(ev->fd_events, fde);
+ if (fde->additional_flags & EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX) {
+ mpx_fde = talloc_get_type_abort(fde->additional_data,
+ struct tevent_fd);
+
+ fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX;
+ mpx_fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX;
+
+ fde->additional_data = NULL;
+ mpx_fde->additional_data = NULL;
+
+ fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_HAS_EVENT;
+ }
+
epoll_ev->panic_state = &panic_triggered;
epoll_check_reopen(epoll_ev);
if (panic_triggered) {
return tevent_common_fd_destructor(fde);
}
+ if (mpx_fde != NULL) {
+ epoll_update_event(epoll_ev, mpx_fde);
+ if (panic_triggered) {
+ return tevent_common_fd_destructor(fde);
+ }
+ }
+
fde->flags = 0;
epoll_update_event(epoll_ev, fde);
fde->flags = flags;