forked from OSchip/llvm-project
Fix Process::ResumeSynchronous which waits a process even in case of error
llvm-svn: 236231
This commit is contained in:
parent
e740409d52
commit
d8c1475f46
|
@ -1731,15 +1731,17 @@ Process::ResumeSynchronous (Stream *stream)
|
|||
HijackProcessEvents(listener_sp.get());
|
||||
|
||||
Error error = PrivateResume();
|
||||
|
||||
StateType state = WaitForProcessToStop (NULL, NULL, true, listener_sp.get(), stream);
|
||||
if (error.Success())
|
||||
{
|
||||
StateType state = WaitForProcessToStop (NULL, NULL, true, listener_sp.get(), stream);
|
||||
const bool must_be_alive = false; // eStateExited is ok, so this must be false
|
||||
if (!StateIsStoppedState(state, must_be_alive))
|
||||
error.SetErrorStringWithFormat("process not in stopped state after synchronous resume: %s", StateAsCString(state));
|
||||
}
|
||||
|
||||
// Undo the hijacking of process events...
|
||||
RestoreProcessEvents();
|
||||
|
||||
if (error.Success() && !StateIsStoppedState(state, false))
|
||||
error.SetErrorStringWithFormat("process not in stopped state after synchronous resume: %s", StateAsCString(state));
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue