tevent: remove unused if (epoll_ev->epoll_fd == -1) return; checks
authorStefan Metzmacher <metze@samba.org>
Wed, 20 Feb 2013 12:07:34 +0000 (13:07 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 1 Mar 2013 17:51:54 +0000 (18:51 +0100)
We'll never leave epoll_check_reopen() with epoll_fd == -1.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
lib/tevent/tevent_epoll.c

index 6ad7b5b3e7a8119032cbb225f539277724b04976..bdf57350fb05e473b3bc5195c0064f6ae1fc4d5b 100644 (file)
@@ -268,8 +268,6 @@ static void epoll_add_event(struct epoll_event_context *epoll_ev, struct tevent_
 {
        struct epoll_event event;
 
-       if (epoll_ev->epoll_fd == -1) return;
-
        fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_REPORT_ERROR;
 
        /* if we don't want events yet, don't add an epoll_event */
@@ -297,8 +295,6 @@ static void epoll_del_event(struct epoll_event_context *epoll_ev, struct tevent_
 {
        struct epoll_event event;
 
-       if (epoll_ev->epoll_fd == -1) return;
-
        fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_REPORT_ERROR;
 
        /* if there's no epoll_event, we don't need to delete it */
@@ -321,7 +317,6 @@ static void epoll_del_event(struct epoll_event_context *epoll_ev, struct tevent_
 static void epoll_mod_event(struct epoll_event_context *epoll_ev, struct tevent_fd *fde)
 {
        struct epoll_event event;
-       if (epoll_ev->epoll_fd == -1) return;
 
        fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_REPORT_ERROR;
 
@@ -345,8 +340,6 @@ static void epoll_change_event(struct epoll_event_context *epoll_ev, struct teve
        bool want_read = (fde->flags & TEVENT_FD_READ);
        bool want_write= (fde->flags & TEVENT_FD_WRITE);
 
-       if (epoll_ev->epoll_fd == -1) return;
-
        fde->additional_flags &= ~EPOLL_ADDITIONAL_FD_FLAG_REPORT_ERROR;
 
        /* there's already an event */
@@ -383,8 +376,6 @@ static int epoll_event_loop(struct epoll_event_context *epoll_ev, struct timeval
        int timeout = -1;
        int wait_errno;
 
-       if (epoll_ev->epoll_fd == -1) return -1;
-
        if (tvalp) {
                /* it's better to trigger timed events a bit later than too early */
                timeout = ((tvalp->tv_usec+999) / 1000) + (tvalp->tv_sec*1000);