[PATCH 2/2] server: Prevent polling on shutdown fd

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


Make sure we're not going to poll on connectionless file descriptors
which have received shutdown signals on their read and write ends.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51319
Signed-off-by: David Koolhoven <david at koolhoven-home.net>
---
 server/sock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server/sock.c b/server/sock.c
index ce2f390ec05..ecf10441c2b 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1197,6 +1197,10 @@ static int sock_get_poll_events( struct fd *fd )
         {
             ev |= POLLOUT;
         }
+        if (sock->rd_shutdown && sock->wr_shutdown && ev == 0)
+        {
+            ev = -1;
+        }
 
         break;
     }
-- 
2.32.0




More information about the wine-devel mailing list