summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-12 04:31:48 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-10-12 04:31:48 +0000
commit30fbe3a93110447a79c2a4e0ded3a17d0a5251b0 (patch)
tree7b92a2500df6c406838ebd77e16eca38d3f4ffe5 /io.c
parent226689a2e889a1d6ad49f13ab1f132370cb7dd0d (diff)
* io.c (rb_cloexec_fcntl_dupfd): get rid of compile error on windows.
reported by Donovan Lampa at [ruby-core:43152] [Backport #6127], based on a patch by Hiroshi Shirosaki at [ruby-core:47917]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@37150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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);