From a9a4435e12ea2ea02d387b1599c855b28ff10757 Mon Sep 17 00:00:00 2001 From: usa Date: Thu, 4 Dec 2008 16:39:03 +0000 Subject: * 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/trunk@20528 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 5829e86d68..80c9f748ba 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -4391,11 +4391,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 v1.2.3