Revert "feature"
[metze/samba/wip.git] / lib / tevent / tevent_select.c
index 9c292ed84de558cca74b6c525ed5b6088ff66941..55dd0b66f66c52eb8fea3e3ed78e973ca643c6bb 100644 (file)
@@ -139,7 +139,7 @@ static struct tevent_fd *select_event_add_fd(struct tevent_context *ev, TALLOC_C
 */
 static int select_event_loop_select(struct select_event_context *select_ev, struct timeval *tvalp)
 {
-       fd_set r_fds, w_fds, e_fds;
+       fd_set r_fds, w_fds;
        struct tevent_fd *fde;
        int selrtn;
        int select_errno;
@@ -151,7 +151,6 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
 
        FD_ZERO(&r_fds);
        FD_ZERO(&w_fds);
-       FD_ZERO(&e_fds);
 
        /* setup any fd events */
        for (fde = select_ev->ev->fd_events; fde; fde = fde->next) {
@@ -166,7 +165,6 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
 
                if (fde->flags & TEVENT_FD_READ) {
                        FD_SET(fde->fd, &r_fds);
-                       FD_SET(fde->fd, &e_fds);
                }
                if (fde->flags & TEVENT_FD_WRITE) {
                        FD_SET(fde->fd, &w_fds);
@@ -179,7 +177,7 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
        }
 
        tevent_trace_point_callback(select_ev->ev, TEVENT_TRACE_BEFORE_WAIT);
-       selrtn = select(select_ev->maxfd+1, &r_fds, &w_fds, &e_fds, tvalp);
+       selrtn = select(select_ev->maxfd+1, &r_fds, &w_fds, NULL, tvalp);
        select_errno = errno;
        tevent_trace_point_callback(select_ev->ev, TEVENT_TRACE_AFTER_WAIT);
 
@@ -214,26 +212,8 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
                for (fde = select_ev->ev->fd_events; fde; fde = fde->next) {
                        uint16_t flags = 0;
 
-                       if (FD_ISSET(fde->fd, &r_fds)) {
-                               int saved_errno = errno;
-                               int available = 0;
-                               int ret;
-
-                               if (fde->flags & TEVENT_FD_READ) {
-                                       flags |= TEVENT_FD_READ;
-                               }
-
-                               /* support for POLLHUP */
-                               ret = ioctl(fde->fd, FIONREAD, &available);
-                               if ((ret == -1) || (available == 0)) {
-                                       /*
-                                        * We should not report TEVENT_FD_WRITE,
-                                        * after getting EOF.
-                                        */
-                                       fde->flags &= ~TEVENT_FD_WRITE;
-                               }
-                               errno = saved_errno;
-
+                       if (FD_ISSET(fde->fd, &r_fds) && (fde->flags & TEVENT_FD_READ)) {
+                               flags |= TEVENT_FD_READ;
                        }
                        if (FD_ISSET(fde->fd, &w_fds) && (fde->flags & TEVENT_FD_WRITE)) {
                                flags |= TEVENT_FD_WRITE;