summaryrefslogtreecommitdiff
path: root/ace/Process.cpp
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-21 04:45:43 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-08-21 04:45:43 +0000
commit1847cc0b6c584a21998d26145c1842498ac232a6 (patch)
treebd06571b5650e17c1b9d25ad0ed76c8db6482e84 /ace/Process.cpp
parent008a93bf19e70bd6f37e20962a8d533fa5898651 (diff)
downloadATCD-1847cc0b6c584a21998d26145c1842498ac232a6.tar.gz
(ACE_Process::wait) Allow passing back of exit status of the child process.
Diffstat (limited to 'ace/Process.cpp')
-rw-r--r--ace/Process.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/ace/Process.cpp b/ace/Process.cpp
index 07d4cf2c39c..e7d2527df36 100644
--- a/ace/Process.cpp
+++ b/ace/Process.cpp
@@ -144,8 +144,16 @@ ACE_Process::wait (int *status)
{
#if defined (ACE_WIN32)
// Notice that status doesn't get updated.
- ACE_UNUSED_ARG (status);
- return ::WaitForSingleObject (process_info_.hProcess, INFINITE);
+ int retv;
+
+ // Don't try to get the process exit status if wait failed so we can
+ // keep the original error code intact.
+ if ((retv = ::WaitForSingleObject (process_info_.hProcess, INFINITE))
+ != WAIT_FAILED)
+ // The error status of GetExitCodeProcess is nontheless not tested.
+ // (Don't know how to return the value.)
+ ::GetExitCodeProcess (process_info_.hProcess, (LPDWORD) status);
+ return retv;
#else /* ACE_WIN32 */
return ACE_OS::waitpid (this->child_id_, status, 0);
#endif /* ACE_WIN32 */