tevent: handle EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX in epoll_update_event()
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Feb 2013 16:17:31 +0000 (17:17 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Mar 2013 18:54:50 +0000 (19:54 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/tevent/tevent_epoll.c

index b1927d31976e39ff534cf396e5cf6123dbe21571..3608d4b6225ca52d2188bd96a2207a8a95a21682 100644 (file)
@@ -545,6 +545,23 @@ static void epoll_update_event(struct epoll_event_context *epoll_ev, struct teve
        bool got_error = (fde->additional_flags & EPOLL_ADDITIONAL_FD_FLAG_GOT_ERROR);
        bool want_read = (fde->flags & TEVENT_FD_READ);
        bool want_write= (fde->flags & TEVENT_FD_WRITE);
+       struct tevent_fd *mpx_fde = NULL;
+
+       if (fde->additional_flags & EPOLL_ADDITIONAL_FD_FLAG_HAS_MPX) {
+               /*
+                * work out what the multiplexed fde wants.
+                */
+               mpx_fde = talloc_get_type_abort(fde->additional_data,
+                                               struct tevent_fd);
+
+               if (mpx_fde->flags & TEVENT_FD_READ) {
+                       want_read = true;
+               }
+
+               if (mpx_fde->flags & TEVENT_FD_WRITE) {
+                       want_write = true;
+               }
+       }
 
        /* there's already an event */
        if (fde->additional_flags & EPOLL_ADDITIONAL_FD_FLAG_HAS_EVENT) {