diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-31 09:59:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-07-31 09:59:01 +0000 |
commit | f46cff647e8999b09e72fb8353de6fcd0c007cc1 (patch) | |
tree | 6fd5ac9d04b8b58b6ecd286185804fa5f1a9f5a2 /io.c | |
parent | b1b58cfd9b1840813a402da73296b676ba319d18 (diff) | |
download | ruby-f46cff647e8999b09e72fb8353de6fcd0c007cc1.tar.gz |
* 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.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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]); |