summaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-15 05:32:53 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-15 05:32:53 +0000
commite4581d63ce1041b8b05ad29018ce72d47e933a27 (patch)
tree60e01e74e55049f34e6f836a9d9c489afdfb0c5f /win32
parent04fe04aa3cc39177bcb4624a5fc8a971ec180c4e (diff)
downloadruby-e4581d63ce1041b8b05ad29018ce72d47e933a27.tar.gz
ruby-e4581d63ce1041b8b05ad29018ce72d47e933a27.tar.xz
ruby-e4581d63ce1041b8b05ad29018ce72d47e933a27.zip
* win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/win32/win32.c b/win32/win32.c
index 7a7078335..c21fca6fb 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -1827,7 +1827,12 @@ rb_w32_fdclr(int fd, fd_set *set)
int
rb_w32_fdisset(int fd, fd_set *set)
{
- return __WSAFDIsSet(TO_SOCKET(fd), set);
+ int ret;
+ SOCKET s = TO_SOCKET(fd);
+ if (s == (SOCKET)INVALID_HANDLE_VALUE)
+ return 0;
+ RUBY_CRITICAL(ret = __WSAFDIsSet(s, set));
+ return ret;
}
//