summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/io.c b/io.c
index 61a77d7a25..9752021119 100644
--- a/io.c
+++ b/io.c
@@ -7607,8 +7607,8 @@ rb_io_s_for_fd(int argc, VALUE *argv, VALUE klass)
static VALUE
rb_io_autoclose_p(VALUE io)
{
- rb_io_t *fptr;
- GetOpenFile(io, fptr);
+ rb_io_t *fptr = RFILE(io)->fptr;
+ rb_io_check_closed(fptr);
return (fptr->mode & FMODE_PREP) ? Qfalse : Qtrue;
}