From b1ab5d1b424de2c493706e56ed192ee5b95d59ea Mon Sep 17 00:00:00 2001 From: kosaki Date: Tue, 30 Aug 2011 20:27:21 +0000 Subject: 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 --- thread.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'thread.c') 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); } -- cgit v1.2.3