about summary refs log tree commit homepage
path: root/ext/raindrops/my_fileno.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/raindrops/my_fileno.h')
-rw-r--r--ext/raindrops/my_fileno.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/raindrops/my_fileno.h b/ext/raindrops/my_fileno.h
index 646f31b..3a0100f 100644
--- a/ext/raindrops/my_fileno.h
+++ b/ext/raindrops/my_fileno.h
@@ -9,9 +9,8 @@ static int my_fileno(VALUE io)
         rb_io_t *fptr;
 
         GetOpenFile(io, fptr);
+        rb_io_check_closed(fptr);
 
-        if (fptr->fd < 0)
-                rb_raise(rb_eIOError, "closed stream");
         return fptr->fd;
 }
 #endif /* Ruby <3.1 !HAVE_RB_IO_DESCRIPTOR */