diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-19 20:40:42 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-08-19 20:40:42 +0000 |
commit | 6056dae7f43492b6f1ad1708552e7a9c4994d9eb (patch) | |
tree | a7dc66c420276eeb1ad5547fd0cf6babfb168113 | |
parent | 883422b19141ca21fcbfa7ae14e70c6f99ca17e1 (diff) | |
download | ruby-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
-rw-r--r-- | thread.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } } |