1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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
This commit is contained in:
normal 2018-08-19 20:40:42 +00:00
parent 883422b191
commit 6056dae7f4

View file

@ -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;
}
}