summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-23 21:38:41 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-11-23 21:38:41 +0000
commita6a7d988b4fe31a6f9a7662662ac8b501933446f (patch)
tree64174fa58b204eb67233d8f09abb4ead83e72113
parent34f0e8edfd5df7e3ca3e6c125863805a95e0af6d (diff)
io.c (io_fd_check_closed): prioritize cross-thread "stream closed"
This may fix failures from TestIO#test_recycled_fd_close because interrupts may be missed due to TOCTOU in other places. cf. http://ci.rvm.jp/results/trunk-nopara@silicon-docker/1475034 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 7085acf467..680659e333 100644
--- a/io.c
+++ b/io.c
@@ -638,7 +638,8 @@ static void
io_fd_check_closed(int fd)
{
if (fd < 0) {
- rb_raise(rb_eIOError, closed_stream);
+ rb_thread_check_ints(); /* check for ruby_error_stream_closed */
+ rb_raise(rb_eIOError, closed_stream);
}
}