summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index 54c3dee767..24fad23a41 100644
--- a/io.c
+++ b/io.c
@@ -3748,6 +3748,7 @@ rb_io_initialize(argc, argv, io)
else {
#if defined(HAVE_FCNTL) && defined(F_GETFL)
flags = fcntl(fd, F_GETFL);
+ if (flags == -1) rb_sys_fail(0);
#else
flags = O_RDONLY;
#endif