From 7eb55c96256bd4c5c8bf3e0742bf51d149face6f Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Sun, 24 Feb 2013 09:45:53 +0000 Subject: [PATCH] Unblock a blocked socket before closing it. git-svn-id: svn://kolibrios.org@3267 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/network/socket.inc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kernel/branches/net/network/socket.inc b/kernel/branches/net/network/socket.inc index e83e3ba098..d27d65abb5 100644 --- a/kernel/branches/net/network/socket.inc +++ b/kernel/branches/net/network/socket.inc @@ -721,6 +721,13 @@ SOCKET_close: mov dword [esp+32], 0 ; The socket exists, so we will succeed in closing it. .socket: + or [eax + SOCKET.options], SO_NONBLOCK ; Mark the socket as non blocking, we dont want it to block any longer! + + test [eax + SOCKET.state], SS_BLOCKED ; Is the socket still in blocked state? + jz @f + call SOCKET_notify.unblock ; Unblock it. + @@: + cmp [eax + SOCKET.Domain], AF_INET4 jne .free