diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -2226,15 +2226,17 @@ rb_io_close_m(VALUE io) } static VALUE -io_close(VALUE io) +io_call_close(VALUE io) { - if (TYPE(io) == T_FILE) { - rb_io_close(io); - return Qnil; - } return rb_funcall(io, rb_intern("close"), 0, 0); } +static VALUE +io_close(VALUE io) +{ + return rb_rescue(io_call_close, io, 0, 0); +} + /* * call-seq: * ios.closed? => true or false |