diff --git a/ChangeLog b/ChangeLog index 940453d7d5..9bdc6df386 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Sun Jul 31 18:58:59 2011 Nobuyoshi Nakada + + * io.c (rb_pipe): pipe on cygwin can succeed half but fail + half. + Sun Jul 31 11:31:07 2011 Kazuki Tsujimoto * vm.c: check if cfp is valid. [Bug #5083] [ruby-dev:44208] 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]);