summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io.c b/io.c
index 04e46e085d..f3badc966a 100644
--- a/io.c
+++ b/io.c
@@ -2064,6 +2064,10 @@ rb_io_close_m(VALUE io)
static VALUE
io_close(VALUE io)
{
+ if (TYPE(io) == T_FILE) {
+ rb_io_close(io);
+ return Qnil;
+ }
return rb_funcall(io, rb_intern("close"), 0, 0);
}