* win32/win32.c (rb_w32_fclose, rb_w32_close): shutdown socket
before closesocket(). fixed: [ruby-dev:25112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e41a1c0f10
commit
bc4088d768
@ -1,3 +1,8 @@
|
||||
Wed Dec 8 11:52:51 2004 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* win32/win32.c (rb_w32_fclose, rb_w32_close): shutdown socket
|
||||
before closesocket(). fixed: [ruby-dev:25112]
|
||||
|
||||
Wed Dec 8 11:46:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (string_content): get rid of segfault at empty evstr.
|
||||
|
@ -3405,6 +3405,8 @@ rb_w32_fclose(FILE *fp)
|
||||
}
|
||||
_set_osfhnd(fd, (SOCKET)INVALID_HANDLE_VALUE);
|
||||
fclose(fp);
|
||||
shutdown(sock, 0);
|
||||
shutdown(sock, 1);
|
||||
if (closesocket(sock) == SOCKET_ERROR) {
|
||||
errno = map_errno(WSAGetLastError());
|
||||
return -1;
|
||||
@ -3421,6 +3423,8 @@ rb_w32_close(int fd)
|
||||
UnlockFile((HANDLE)sock, 0, 0, LK_LEN, LK_LEN);
|
||||
return _close(fd);
|
||||
}
|
||||
shutdown(sock, 0);
|
||||
shutdown(sock, 1);
|
||||
if (closesocket(sock) == SOCKET_ERROR) {
|
||||
errno = map_errno(WSAGetLastError());
|
||||
return -1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user