summaryrefslogtreecommitdiffstats
path: root/win32
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-18 09:10:04 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-18 09:10:04 +0000
commitc318d60646c0929b55b68fb73a1abb5002275f30 (patch)
treefc4f4802733f5de4dcb75895726079d3bb5bafa7 /win32
parent2ecbad2653ac7e9d97ec7d4ed03579260322254c (diff)
downloadruby-c318d60646c0929b55b68fb73a1abb5002275f30.tar.gz
ruby-c318d60646c0929b55b68fb73a1abb5002275f30.tar.xz
ruby-c318d60646c0929b55b68fb73a1abb5002275f30.zip
* win32/win32.c (poll_child_status): set EINVAL to errno when
GetExitCodeProcess() fails with ERROR_INVALID_HANDLE. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17409 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'win32')
-rw-r--r--win32/win32.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/win32/win32.c b/win32/win32.c
index b62adad77..813c4ee19 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;
}