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_wait_fd_rw): fix infinite loop bug.

rb_wait_for_single_fd() never return positive number.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38447 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2012-12-18 10:07:05 +00:00
parent dff59f6c5d
commit 005db82d36
2 changed files with 8 additions and 5 deletions

View file

@ -1,3 +1,8 @@
Tue Dec 18 18:55:33 2012 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (rb_thread_wait_fd_rw): fix infinite loop bug.
rb_wait_for_single_fd() never return positive number.
Tue Dec 18 17:24:40 2012 Eric Hodel <drbrain@segment7.net>
* lib/rdoc/encoding.rb: Do not remove #! line from document when

View file

@ -3320,12 +3320,10 @@ rb_thread_wait_fd_rw(int fd, int read)
if (fd < 0) {
rb_raise(rb_eIOError, "closed stream");
}
while (result <= 0) {
result = rb_wait_for_single_fd(fd, events, NULL);
if (result < 0) {
rb_sys_fail(0);
}
result = rb_wait_for_single_fd(fd, events, NULL);
if (result < 0) {
rb_sys_fail(0);
}
thread_debug("rb_thread_wait_fd_rw(%d, %s): done\n", fd, read ? "read" : "write");