summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-31 09:59:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-07-31 09:59:01 +0000
commitf46cff647e8999b09e72fb8353de6fcd0c007cc1 (patch)
tree6fd5ac9d04b8b58b6ecd286185804fa5f1a9f5a2 /io.c
parentb1b58cfd9b1840813a402da73296b676ba319d18 (diff)
* io.c (rb_pipe): pipe on cygwin can succeed half but fail
half. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/io.c b/io.c
index 5e52ea6265..6be4e88744 100644
--- a/io.c
+++ b/io.c
@@ -4914,6 +4914,14 @@ rb_pipe(int *pipes)
ret = pipe(pipes);
}
}
+#ifdef __CYGWIN__
+ if (ret == 0 && pipes[1] == -1) {
+ close(pipes[0]);
+ pipes[0] = -1;
+ errno = ENFILE;
+ return -1;
+ }
+#endif
if (ret == 0) {
rb_update_max_fd(pipes[0]);
rb_update_max_fd(pipes[1]);