Zebediah Figura : server: Allow polling on an fd after it was removed.

Alexandre Julliard julliard at winehq.org
Tue May 18 15:42:37 CDT 2021


Module: wine
Branch: master
Commit: 737fe1f99337ab999cf67fb1acdf96f70020b3d4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=737fe1f99337ab999cf67fb1acdf96f70020b3d4

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Mon May 17 21:29:58 2021 -0500

server: Allow polling on an fd after it was removed.

In particular, so that we can wait for POLLOUT on a connecting socket multiple
times, in case the first connection fails, without polling on it while it is
unconnected.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 server/fd.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/server/fd.c b/server/fd.c
index 481e9a88f0f..e7253ec8f51 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -549,7 +549,6 @@ static inline void set_fd_epoll_events( struct fd *fd, int user, int events )
     }
     else if (pollfd[user].fd == -1)
     {
-        if (pollfd[user].events) return;  /* stopped waiting on it, don't restart */
         ctl = EPOLL_CTL_ADD;
     }
     else
@@ -658,7 +657,6 @@ static inline void set_fd_epoll_events( struct fd *fd, int user, int events )
     }
     else if (pollfd[user].fd == -1)
     {
-        if (pollfd[user].events) return;  /* stopped waiting on it, don't restart */
         ev[0].flags |= EV_ADD | ((events & POLLIN) ? EV_ENABLE : EV_DISABLE);
         ev[1].flags |= EV_ADD | ((events & POLLOUT) ? EV_ENABLE : EV_DISABLE);
     }
@@ -767,7 +765,6 @@ static inline void set_fd_epoll_events( struct fd *fd, int user, int events )
     }
     else if (pollfd[user].fd == -1)
     {
-        if (pollfd[user].events) return;  /* stopped waiting on it, don't restart */
         ret = port_associate( port_fd, PORT_SOURCE_FD, fd->unix_fd, events, (void *)user );
     }
     else
@@ -1647,7 +1644,7 @@ void set_fd_events( struct fd *fd, int events )
         pollfd[user].events = POLLERR;
         pollfd[user].revents = 0;
     }
-    else if (pollfd[user].fd != -1 || !pollfd[user].events)
+    else
     {
         pollfd[user].fd = fd->unix_fd;
         pollfd[user].events = events;




More information about the wine-cvs mailing list