diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-15 05:31:32 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-12-15 05:31:32 +0000 |
| commit | d6016973833a31fba1a2eb532293797f71679a3b (patch) | |
| tree | 6c83ccf0adf1bc1c938e5ac87a2f81fe221c702d | |
| parent | 00855b8c3a8f38527c5d2635585199a27694b0e2 (diff) | |
| download | ruby-d6016973833a31fba1a2eb532293797f71679a3b.tar.gz ruby-d6016973833a31fba1a2eb532293797f71679a3b.tar.xz ruby-d6016973833a31fba1a2eb532293797f71679a3b.zip | |
* win32/win32.c (rb_w32_fdisset): check whether the handle is valid.
fixed: [ruby-core:03959]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | win32/win32.c | 7 |
2 files changed, 11 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Wed Dec 15 14:22:10 2004 NAKAMURA Usaku <usa@ruby-lang.org> + + * win32/win32.c (rb_w32_fdisset): check whether the handle is valid. + fixed: [ruby-core:03959] + Wed Dec 15 10:30:37 2004 Yukihiro Matsumoto <matz@ruby-lang.org> * ext/openssl/ossl_digest.c (ossl_digest_initialize): [ruby-dev:25198] diff --git a/win32/win32.c b/win32/win32.c index 72ca08f55..a4cea9b28 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1811,7 +1811,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; } // |
