summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-21 05:27:06 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-21 05:27:06 +0000
commit82d84b497131d27832c5e0250b89ade75bf3d6b7 (patch)
treef4dad2a6dfaec65abe30fe51a25af4ffdfd28eaa /win32
parenta23661bbe50ea56630de789ea4291e29a2e341ce (diff)
merges r20528 from trunk into ruby_1_9_1.
* win32/win32.c (rb_w32_read): ERROR_BROKEN_PIPE is not a real error at this point. * io.c (pipe_open): use rb_w32_spawn() instead of rb_w32_pipe_exec() to use our own redirection scheme. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_1@20897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/win32/win32.c b/win32/win32.c
index eb062f5c03..872fcd013c 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4395,11 +4395,15 @@ rb_w32_read(int fd, void *buf, size_t size)
if (!GetOverlappedResult((HANDLE)_osfhnd(fd), &ol, &read, TRUE) &&
(err = GetLastError()) != ERROR_HANDLE_EOF) {
- errno = map_errno(err);
+ int ret = 0;
+ if (err != ERROR_BROKEN_PIPE) {
+ errno = map_errno(err);
+ ret = -1;
+ }
CloseHandle(ol.hEvent);
cancel_io((HANDLE)_osfhnd(fd));
MTHREAD_ONLY(LeaveCriticalSection(&_pioinfo(fd)->lock));
- return -1;
+ return ret;
}
}
}