* win32/win32.c: wait process real termination after reading
exit code. fixes #4518 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f06ec31c54
commit
50ff6ed866
@ -1,3 +1,8 @@
|
|||||||
|
Wed Mar 23 00:12:16 2011 Tajima Akio <artonx@yahoo.co.jp>
|
||||||
|
|
||||||
|
* win32/win32.c: wait process real termination after reading
|
||||||
|
exit code. fixes #4518
|
||||||
|
|
||||||
Tue Mar 22 21:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
Tue Mar 22 21:20:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
* lib/rubygems/test_case.rb: save current dir to @current_dir
|
* lib/rubygems/test_case.rb: save current dir to @current_dir
|
||||||
|
@ -3549,6 +3549,7 @@ poll_child_status(struct ChildRecord *child, int *stat_loc)
|
|||||||
|
|
||||||
if (!GetExitCodeProcess(child->hProcess, &exitcode)) {
|
if (!GetExitCodeProcess(child->hProcess, &exitcode)) {
|
||||||
/* If an error occured, return immediatly. */
|
/* If an error occured, return immediatly. */
|
||||||
|
error_exit:
|
||||||
err = GetLastError();
|
err = GetLastError();
|
||||||
if (err == ERROR_INVALID_PARAMETER)
|
if (err == ERROR_INVALID_PARAMETER)
|
||||||
errno = ECHILD;
|
errno = ECHILD;
|
||||||
@ -3562,7 +3563,12 @@ poll_child_status(struct ChildRecord *child, int *stat_loc)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (exitcode != STILL_ACTIVE) {
|
if (exitcode != STILL_ACTIVE) {
|
||||||
/* If already died, return immediatly. */
|
rb_pid_t pid;
|
||||||
|
/* If already died, wait process's real termination. */
|
||||||
|
if (rb_w32_wait_events_blocking(&child->hProcess, 1, INFINITE) != WAIT_OBJECT_0) {
|
||||||
|
goto error_exit;
|
||||||
|
}
|
||||||
|
pid = child->pid;
|
||||||
rb_pid_t pid = child->pid;
|
rb_pid_t pid = child->pid;
|
||||||
CloseChildHandle(child);
|
CloseChildHandle(child);
|
||||||
if (stat_loc) *stat_loc = exitcode << 8;
|
if (stat_loc) *stat_loc = exitcode << 8;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user