summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-30 15:04:11 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-30 15:04:11 +0000
commitee7d523631de5755a1b4d8ee1fe8ab8a15edfcde (patch)
tree499adb60dd741f41fa404179e4c052b4cb278e33 /thread.c
parent527be1b25a3192fffa143ef4bb520c9812e8324d (diff)
* win32/win32.c, include/ruby/intern.h (rb_w32_fd_copy): implement
for rb_thread_select() in thread.c. the use of rb_fd_copy() is introduced in r33117. [Bug #5229] [ruby-core:39102] * thread.c (rb_thread_select): must call rb_fd_init() before using rb_fdset_t. see the implementations of rb_fd_init()s if you want to know the reason. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 2ec8b80265..a09c39eed4 100644
--- a/thread.c
+++ b/thread.c
@@ -2686,7 +2686,7 @@ int
rb_thread_select(int max, fd_set * read, fd_set * write, fd_set * except,
struct timeval *timeout)
{
- rb_fdset_t fdsets[3] = { 0 };
+ rb_fdset_t fdsets[3];
rb_fdset_t *rfds = NULL;
rb_fdset_t *wfds = NULL;
rb_fdset_t *efds = NULL;
@@ -2694,14 +2694,17 @@ rb_thread_select(int max, fd_set * read, fd_set * write, fd_set * except,
if (read) {
rfds = &fdsets[0];
+ rb_fd_init(rfds);
rb_fd_copy(rfds, read, max);
}
if (write) {
wfds = &fdsets[1];
+ rb_fd_init(wfds);
rb_fd_copy(wfds, write, max);
}
if (except) {
efds = &fdsets[2];
+ rb_fd_init(wfds);
rb_fd_copy(efds, except, max);
}