Alexandre Julliard : server: Explicitly shutdown destroyed sockets to force pending poll() calls to return.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Dec 5 04:50:56 CST 2006


Module: wine
Branch: master
Commit: 24b64534e592e47e5cac70e497a98c0ddbc3941b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=24b64534e592e47e5cac70e497a98c0ddbc3941b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Dec  4 18:02:02 2006 +0100

server: Explicitly shutdown destroyed sockets to force pending poll() calls to return.

---

 server/sock.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/server/sock.c b/server/sock.c
index a98057f..7c96f5f 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -583,7 +583,12 @@ static void sock_destroy( struct object
         async_terminate_queue( &sock->write_q, STATUS_CANCELLED );
     }
     if (sock->event) release_object( sock->event );
-    if (sock->fd) release_object( sock->fd );
+    if (sock->fd)
+    {
+        /* shut the socket down to force pending poll() calls in the client to return */
+        shutdown( get_unix_fd(sock->fd), SHUT_RDWR );
+        release_object( sock->fd );
+    }
 }
 
 /* create a new and unconnected socket */




More information about the wine-cvs mailing list