ruby-changes:21209
From: kosaki <ko1@a...>
Date: Mon, 12 Sep 2011 20:51:27 +0900 (JST)
Subject: [ruby-changes:21209] kosaki:r33258 (ruby_1_9_3): * Backport r33231.
kosaki 2011-09-12 20:51:11 +0900 (Mon, 12 Sep 2011) New Revision: 33258 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33258 Log: * Backport r33231. * thread.c (rb_thread_select): fix a typo to initialize efds properly. [Bug #5299] [ruby-core:39380] Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/test/-ext-/old_thread_select/test_old_thread_select.rb branches/ruby_1_9_3/thread.c Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33257) +++ ruby_1_9_3/ChangeLog (revision 33258) @@ -1,3 +1,8 @@ +Mon Sep 12 20:47:52 2011 Nobuyoshi Nakada <nobu@r...> + + * thread.c (rb_thread_select): fix a typo to initialize efds + properly. [Bug #5299] [ruby-core:39380] + Mon Sep 12 20:41:20 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * thread.c (rb_thread_select): fix to ignore an argument Index: ruby_1_9_3/thread.c =================================================================== --- ruby_1_9_3/thread.c (revision 33257) +++ ruby_1_9_3/thread.c (revision 33258) @@ -2726,7 +2726,7 @@ } if (except) { efds = &fdsets[2]; - rb_fd_init(wfds); + rb_fd_init(efds); rb_fd_copy(efds, except, max); } Index: ruby_1_9_3/test/-ext-/old_thread_select/test_old_thread_select.rb =================================================================== --- ruby_1_9_3/test/-ext-/old_thread_select/test_old_thread_select.rb (revision 33257) +++ ruby_1_9_3/test/-ext-/old_thread_select/test_old_thread_select.rb (revision 33258) @@ -23,6 +23,17 @@ end end + def test_old_select_error_timeout + bug5299 = '[ruby-core:39380]' + with_pipe do |r, w| + t0 = Time.now + rc = IO.old_thread_select(nil, nil, [r.fileno], 0.001) + diff = Time.now - t0 + assert_equal 0, rc, bug5299 + assert_operator diff, :>=, 0.001, "returned too early" + end + end + def test_old_select_false_positive bug5306 = '[ruby-core:39435]' with_pipe do |r2, w2| @@ -77,7 +88,7 @@ assert_equal 0, rc assert_equal true, thr.value assert received, "SIGINT not received" - ensure - trap(:INT, "DEFAULT") + ensure + trap(:INT, "DEFAULT") end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/