summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-30 20:27:21 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-30 20:27:21 +0000
commitb1ab5d1b424de2c493706e56ed192ee5b95d59ea (patch)
tree2d9c00fbff9bf61e9320e797f52fc46fde4a4f04 /thread.c
parentee56dd160e410e2a44ae7d861b8520810f957416 (diff)
merge revision(s) 33128:
* 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/branches/ruby_1_9_3@33134 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 f14cba7d12..9e70a1e386 100644
--- a/thread.c
+++ b/thread.c
@@ -2682,7 +2682,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;
@@ -2690,14 +2690,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);
}