summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-04 16:39:03 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-04 16:39:03 +0000
commita9a4435e12ea2ea02d387b1599c855b28ff10757 (patch)
tree824dc0204edbab172e1f8b0c6e6d47155b92a635 /win32
parentc7bd98b7b8848f7d20b44cdb4878d024c3692bc4 (diff)
* 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
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 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;
}
}
}