forked from qt-creator/qt-creator
fix waiting in SynchronousProcess::runBlocking()
the conditions on the waitForFinished() calls were inverted. the visible effect of this was that 'Hang' was never reported. Change-Id: I9937fce58189eebf891000840597158b4bffd028 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -537,11 +537,11 @@ SynchronousProcessResponse SynchronousProcess::runBlocking(const CommandLine &cm
|
||||
return d->m_result;
|
||||
}
|
||||
d->m_process.closeWriteChannel();
|
||||
if (d->m_process.waitForFinished(d->m_maxHangTimerCount * 1000)) {
|
||||
if (!d->m_process.waitForFinished(d->m_maxHangTimerCount * 1000)) {
|
||||
if (d->m_process.state() == QProcess::Running) {
|
||||
d->m_result.result = SynchronousProcessResponse::Hang;
|
||||
d->m_process.terminate();
|
||||
if (d->m_process.waitForFinished(1000) && d->m_process.state() == QProcess::Running) {
|
||||
if (!d->m_process.waitForFinished(1000) && d->m_process.state() == QProcess::Running) {
|
||||
d->m_process.kill();
|
||||
d->m_process.waitForFinished(1000);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user