diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-18 09:10:04 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-06-18 09:10:04 +0000 |
commit | 32c63d1f3567a8b096c13ebf1c77621abc0a8d78 (patch) | |
tree | fc4f4802733f5de4dcb75895726079d3bb5bafa7 /win32/win32.c | |
parent | 6874320d20763fdc77d915aac71cfe7ecdd1a000 (diff) | |
download | ruby-32c63d1f3567a8b096c13ebf1c77621abc0a8d78.tar.gz |
* win32/win32.c (poll_child_status): set EINVAL to errno when
GetExitCodeProcess() fails with ERROR_INVALID_HANDLE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32/win32.c')
-rw-r--r-- | win32/win32.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/win32/win32.c b/win32/win32.c index b62adad774..813c4ee191 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -2007,9 +2007,9 @@ is_pipe(SOCKET sock) /* DONT call this for SOCKET! it clains it is PIPE. */ { int ret; - RUBY_CRITICAL( - ret = (GetFileType((HANDLE)sock) == FILE_TYPE_PIPE) - ); + RUBY_CRITICAL({ + ret = (GetFileType((HANDLE)sock) == FILE_TYPE_PIPE); + }); return ret; } @@ -2857,8 +2857,12 @@ poll_child_status(struct ChildRecord *child, int *stat_loc) err = GetLastError(); if (err == ERROR_INVALID_PARAMETER) errno = ECHILD; - else - errno = map_errno(GetLastError()); + else { + if (GetLastError() == ERROR_INVALID_HANDLE) + errno = EINVAL; + else + errno = map_errno(GetLastError()); + } CloseChildHandle(child); return -1; } |