summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 5dafc0320f..7a7078335f 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -3421,6 +3421,7 @@ rb_w32_close(int fd)
UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN);
return _close(fd);
}
+ _set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);
if (closesocket(sock) == SOCKET_ERROR) {
errno = map_errno(WSAGetLastError());
return -1;