eloop: don't warn when removing bad fds from epoll-set
authorDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 27 Sep 2012 17:15:28 +0000 (19:15 +0200)
committerDavid Herrmann <dh.herrmann@googlemail.com>
Thu, 27 Sep 2012 17:15:28 +0000 (19:15 +0200)
People might want to close file-descriptors before destroying the ev_fd
object if they actually have no direct control of it. For instance if used
through a library.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
src/eloop.c

index c83dcb4..7762a27 100644 (file)
@@ -1166,7 +1166,7 @@ static void fd_epoll_remove(struct ev_fd *fd)
                return;
 
        ret = epoll_ctl(fd->loop->efd, EPOLL_CTL_DEL, fd->fd, NULL);
-       if (ret)
+       if (ret && errno != EBADF)
                llog_warning(fd, "cannot remove fd %d from epoll set (%d): %m",
                             fd->fd, errno);
 }