summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 681ba97ec3..debb94a7cd 100644
--- a/io.c
+++ b/io.c
@@ -1859,6 +1859,9 @@ rb_fdopen(fd, mode)
file = fdopen(fd, mode);
}
if (!file) {
+#ifdef _WIN32
+ if (errno == 0) errno = EINVAL;
+#endif
rb_sys_fail(0);
}
}