Eric Wong <normalperson / yhbt.net> wrote:
> Thanks for testing, think I have a better fix below (supercedes my
> original fix)
>  
> Also pushed to the "io-close-fixes" branch of git://bogomips.org/ruby.git

Oops, I broke test/ruby/test_thread.rb in the atexit handlers :x
I squashed the following change and forcibly repushed:

diff --git a/io.c b/io.c
index 5d37b7f..65e7693 100644
--- a/io.c
+++ b/io.c
@@ -3562,7 +3562,8 @@ fptr_finalize(rb_io_t *fptr, int noraise)
 
         fptr->stdio_file = 0;
         fptr->fd = -1;
-        rb_thread_fd_close(fd);
+        if (!noraise)
+	    rb_thread_fd_close(fd);
         goto skip_fd_close;
     }
     if (fptr->stdio_file) {
-- 
Eric Wong