[PATCH 1/2] server: Only remove non-listening fd from poll

David Koolhoven david at koolhoven-home.net
Fri Jul 2 13:06:48 CDT 2021


This makes sure we poll listening non-connection
file descriptors even if the event is POLLERR or POLLHUP.

Signed-off-by: David Koolhoven <david at koolhoven-home.net>
---
 server/sock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/sock.c b/server/sock.c
index befa9117c13..ce2f390ec05 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1024,7 +1024,7 @@ static void sock_poll_event( struct fd *fd, int event )
         fprintf(stderr, "socket %p select event: %x\n", sock, event);
 
     /* we may change event later, remove from loop here */
-    if (event & (POLLERR|POLLHUP)) set_fd_events( sock->fd, -1 );
+    if (event & (POLLERR|POLLHUP) && sock->state != SOCK_LISTENING) set_fd_events( sock->fd, -1 );
 
     switch (sock->state)
     {
-- 
2.32.0




More information about the wine-devel mailing list