diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-21 05:27:06 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-21 05:27:06 +0000 |
commit | caa851abcdd87b1a83cb637e58d43efc622413bc (patch) | |
tree | f4dad2a6dfaec65abe30fe51a25af4ffdfd28eaa /win32 | |
parent | 9ce0f984413fc712359a9c6893683e9d17480000 (diff) | |
download | ruby-caa851abcdd87b1a83cb637e58d43efc622413bc.tar.gz ruby-caa851abcdd87b1a83cb637e58d43efc622413bc.tar.xz ruby-caa851abcdd87b1a83cb637e58d43efc622413bc.zip |
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
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 8 |
1 files changed, 6 insertions, 2 deletions
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; } } } |