summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/io.c b/io.c
index 5821b4a434..d6dc635149 100644
--- a/io.c
+++ b/io.c
@@ -209,8 +209,11 @@ rb_cloexec_fcntl_dupfd(int fd, int minfd)
else {
ret = fcntl(fd, F_DUPFD, minfd);
}
-#else
+#elif defined(F_DUPFD)
ret = fcntl(fd, F_DUPFD, minfd);
+#else
+ ret = -1;
+ errno = EINVAL;
#endif
if (ret == -1) return -1;
rb_maygvl_fd_fix_cloexec(ret);