TODO tevent POLLRDHUP
[metze/samba/wip.git] / lib / tevent / tevent_epoll.c
index 1f1f47b2b21189d124997f950c2db11bb74ba310..19b644bb01dac1628084f7f5bddebe4e1877bcf5 100644 (file)
@@ -174,7 +174,7 @@ static void epoll_panic(struct epoll_event_context *epoll_ev,
 static uint32_t epoll_map_flags(uint16_t flags)
 {
        uint32_t ret = 0;
-       if (flags & TEVENT_FD_READ) ret |= (EPOLLIN | EPOLLERR | EPOLLHUP);
+       if (flags & TEVENT_FD_READ) ret |= (EPOLLIN | EPOLLERR | EPOLLHUP | EPOLLRDHUP);
        if (flags & TEVENT_FD_WRITE) ret |= (EPOLLOUT | EPOLLERR | EPOLLHUP);
        return ret;
 }
@@ -687,7 +687,7 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
                        mpx_fde = talloc_get_type_abort(fde->additional_data,
                                                        struct tevent_fd);
                }
-               if (events[i].events & (EPOLLHUP|EPOLLERR)) {
+               if (events[i].events & (EPOLLHUP|EPOLLERR|EPOLLRDHUP)) {
                        bool handled_fde = epoll_handle_hup_or_err(epoll_ev, fde);
                        bool handled_mpx = epoll_handle_hup_or_err(epoll_ev, mpx_fde);