aboutsummaryrefslogtreecommitdiffstats
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
commitf598caf62157148856aec37d3b8d6c2c9086695a (patch)
tree60e01e74e55049f34e6f836a9d9c489afdfb0c5f
parent6982d10a7e69bbc22ecc3d6658d4adbc1a91a94d (diff)
downloadruby-f598caf62157148856aec37d3b8d6c2c9086695a.tar.gz
* win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7561 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--win32/win32.c7
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 62d5ae1778..911dea4e74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Dec 15 14:32:18 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
+
Tue Dec 14 19:17:15 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
* utf8.c (utf8_is_mbc_ambiguous): [ruby-talk:123561]
diff --git a/win32/win32.c b/win32/win32.c
index 7a7078335f..c21fca6fbc 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;
}
//