summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2013-02-20 11:50:56 +0100
committerJeremy Allison <jra@samba.org>2013-03-01 12:01:21 -0800
commit16a072ec1cddd75f6df656f69935ad55f71f4a28 (patch)
tree81e55cb397f0cdf5be26f70303ff33eed3869825
parentfa4f1713f9802ff06007b43afd90357da0f98f73 (diff)
downloadsamba-16a072ec1cddd75f6df656f69935ad55f71f4a28.tar.gz
samba-16a072ec1cddd75f6df656f69935ad55f71f4a28.tar.bz2
samba-16a072ec1cddd75f6df656f69935ad55f71f4a28.zip
tevent: preferr the write handler if there're two possible handlers registered with epoll
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--lib/tevent/tevent_epoll.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tevent/tevent_epoll.c b/lib/tevent/tevent_epoll.c
index 41415b06e9..19f6809f27 100644
--- a/lib/tevent/tevent_epoll.c
+++ b/lib/tevent/tevent_epoll.c
@@ -702,6 +702,16 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
if (events[i].events & EPOLLIN) flags |= TEVENT_FD_READ;
if (events[i].events & EPOLLOUT) flags |= TEVENT_FD_WRITE;
+ if (flags & TEVENT_FD_WRITE) {
+ if (fde->flags & TEVENT_FD_WRITE) {
+ mpx_fde = NULL;
+ }
+ if (mpx_fde && mpx_fde->flags & TEVENT_FD_WRITE) {
+ fde = mpx_fde;
+ mpx_fde = NULL;
+ }
+ }
+
if (mpx_fde) {
/* Ensure we got the right fde. */
if ((flags & fde->flags) == 0) {