1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2011-07-31 09:59:01 +00:00
parent b1b58cfd9b
commit f46cff647e
2 changed files with 13 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Sun Jul 31 18:58:59 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
* io.c (rb_pipe): pipe on cygwin can succeed half but fail
half.
Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto <kazuki@callcc.net>
* vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208]

8
io.c
View file

@ -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]);