From caa851abcdd87b1a83cb637e58d43efc622413bc Mon Sep 17 00:00:00 2001 From: yugui Date: Sun, 21 Dec 2008 05:27:06 +0000 Subject: 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: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- win32/win32.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'win32') diff --git a/win32/win32.c b/win32/win32.c index eb062f5c0..872fcd013 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; } } } -- cgit