[前][次][番号順一覧][スレッド一覧]

ruby-changes:21182

From: nobu <ko1@a...>
Date: Fri, 9 Sep 2011 10:22:28 +0900 (JST)
Subject: [ruby-changes:21182] nobu:r33231 (trunk): * thread.c (rb_thread_select): fix a typo to initialize efds

nobu	2011-09-09 10:22:06 +0900 (Fri, 09 Sep 2011)

  New Revision: 33231

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33231

  Log:
    * thread.c (rb_thread_select): fix a typo to initialize efds
      properly.  [Bug #5299] [ruby-core:39380]

  Modified files:
    trunk/ChangeLog
    trunk/test/-ext-/old_thread_select/test_old_thread_select.rb
    trunk/thread.c

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 33230)
+++ ChangeLog	(revision 33231)
@@ -1,3 +1,8 @@
+Fri Sep  9 10:22:03 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread.c (rb_thread_select): fix a typo to initialize efds
+	  properly.  [Bug #5299] [ruby-core:39380]
+
 Fri Sep  9 02:02:09 2011  Ayumu AIZAWA  <ayumu.aizawa@g...>
 
 	* template/yarvarch.ja:
Index: thread.c
===================================================================
--- thread.c	(revision 33230)
+++ thread.c	(revision 33231)
@@ -2704,7 +2704,7 @@
     }
     if (except) {
 	efds = &fdsets[2];
-	rb_fd_init(wfds);
+	rb_fd_init(efds);
 	rb_fd_copy(efds, except, max);
     }
 
Index: test/-ext-/old_thread_select/test_old_thread_select.rb
===================================================================
--- test/-ext-/old_thread_select/test_old_thread_select.rb	(revision 33230)
+++ test/-ext-/old_thread_select/test_old_thread_select.rb	(revision 33231)
@@ -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_read_write_check
     with_pipe do |r, w|
       w.syswrite('.')
@@ -63,7 +74,7 @@
     assert_equal 0, rc
     assert_equal true, thr.value
     assert_not_equal false, 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/

[前][次][番号順一覧][スレッド一覧]