Mercurial > ecos-v3_0-branch
diff host/tools/Utils/common/Subprocess.cpp @ 177:4c750ce71ae3
Merge from eCos master repository on 2001-08-10-19:22:57-BST
| author | jlarmour |
|---|---|
| date | Fri, 10 Aug 2001 19:27:55 +0000 |
| parents | 489eb5632bc3 |
| children | a22e535e2a4c |
line wrap: on
line diff
--- a/host/tools/Utils/common/Subprocess.cpp +++ b/host/tools/Utils/common/Subprocess.cpp @@ -259,6 +259,8 @@ void CSubprocess::ThreadFunc() DWORD dwAvail; + DWORD dwExitCode; + while (!m_bKillThread && m_pfnContinue(m_pContinuationFuncParam) && ::PeekNamedPipe(m_hrPipe, NULL, 0, 0, &dwAvail, NULL)){ //TRACE(_T("P%d\n"),dwAvail); if(dwAvail){ @@ -274,15 +276,23 @@ void CSubprocess::ThreadFunc() buf[dwRead]='\0'; Output(String::CStrToUnicodeStr(buf)); delete [] buf; - } else if(!ProcessAlive()){ - TRACE(_T("m_bThreadTerminated=%d\n"),m_bThreadTerminated); - break; - } else { + } + else if (!ProcessAlive()) + { + TRACE(_T("m_bThreadTerminated=%d\n"),m_bThreadTerminated); + break; + } + // Fix for hanging in an endless loop under Windows ME, by Bill Diehls <billabloke@yahoo.com> + else if (::GetExitCodeProcess(m_hProcess, &dwExitCode) && dwExitCode!=STILL_ACTIVE) + { + break; + } + else + { CeCosThreadUtils::Sleep(250); } } - DWORD dwExitCode; ::GetExitCodeProcess(m_hProcess, &dwExitCode); m_nExitCode=dwExitCode;
