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 2c2fa80f15..7b7a1a787e 100644
--- a/io.c
+++ b/io.c
@@ -2134,6 +2134,10 @@ static VALUE
io_close(io)
VALUE io;
{
+ if (TYPE(io) == T_FILE) {
+ rb_io_close(io);
+ return Qnil;
+ }
return rb_funcall(io, rb_intern("close"), 0, 0);
}