summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-19 20:40:42 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-19 20:40:42 +0000
commit6056dae7f43492b6f1ad1708552e7a9c4994d9eb (patch)
treea7dc66c420276eeb1ad5547fd0cf6babfb168113 /thread.c
parent883422b19141ca21fcbfa7ae14e70c6f99ca17e1 (diff)
downloadruby-6056dae7f43492b6f1ad1708552e7a9c4994d9eb.tar.gz
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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 8254c7dc0c..c756b53bea 100644
--- a/thread.c
+++ b/thread.c
@@ -4028,7 +4028,7 @@ rb_thread_fd_select(int max, rb_fdset_t * read, rb_fdset_t * write, rb_fdset_t *
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;
}
}