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

ruby-changes:52267

From: normal <ko1@a...>
Date: Mon, 20 Aug 2018 05:40:48 +0900 (JST)
Subject: [ruby-changes:52267] normal:r64475 (trunk): thread.c (rb_thread_fd_select): fix off-by-one with sigwait_fd

normal	2018-08-20 05:40:42 +0900 (Mon, 20 Aug 2018)

  New Revision: 64475

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64475

  Log:
    thread.c (rb_thread_fd_select): fix off-by-one with sigwait_fd
    
    select(2) needs the nfds argument to be one higher than the
    largest FD in the sets :x

  Modified files:
    trunk/thread.c
Index: thread.c
===================================================================
--- thread.c	(revision 64474)
+++ thread.c	(revision 64475)
@@ -4028,7 +4028,7 @@ rb_thread_fd_select(int max, rb_fdset_t https://github.com/ruby/ruby/blob/trunk/thread.c#L4028
             rb_fd_set(set.sigwait_fd, set.rset);
         else
             set.rset = init_set_fd(set.sigwait_fd, &set.orig_rset);
-        if (set.sigwait_fd > set.max) {
+        if (set.sigwait_fd >= set.max) {
             set.max = set.sigwait_fd + 1;
         }
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

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