diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-06-14 12:07:38 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2018-06-14 11:40:27 +0000 |
commit | a838fd23288370e4e9898b30d9b57803d93a6597 (patch) | |
tree | b87c5d381a8a3cec0dfc3ef4edfabb44fb099406 | |
parent | a666dedaad7d63d758f57f6e58ca285f80b5f0cd (diff) |
Call QProcess::waitForFinished with timeout of -1
The default value of 30 s can be too short for environments like
virtual machines under heavy load.
Task-number: QBS-1360
Change-Id: I83af7740dc842faf8795f5901f36744229160154
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r-- | src/app/qbs-setup-toolchains/xcodeprobe.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/api/runenvironment.cpp | 4 | ||||
-rw-r--r-- | src/lib/corelib/tools/msvcinfo.cpp | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/app/qbs-setup-toolchains/xcodeprobe.cpp b/src/app/qbs-setup-toolchains/xcodeprobe.cpp index 857a3d231..2cb54f5b9 100644 --- a/src/app/qbs-setup-toolchains/xcodeprobe.cpp +++ b/src/app/qbs-setup-toolchains/xcodeprobe.cpp @@ -102,7 +102,7 @@ void XcodeProbe::detectDeveloperPaths() QString program = QLatin1String("/usr/bin/xcode-select"); QStringList arguments(QLatin1String("--print-path")); selectedXcode.start(program, arguments, QProcess::ReadOnly); - if (!selectedXcode.waitForFinished() || selectedXcode.exitCode()) { + if (!selectedXcode.waitForFinished(-1) || selectedXcode.exitCode()) { qbsInfo() << Tr::tr("Could not detect selected Xcode with /usr/bin/xcode-select"); } else { QString path = QString::fromLocal8Bit(selectedXcode.readAllStandardOutput()); @@ -114,7 +114,7 @@ void XcodeProbe::detectDeveloperPaths() program = QLatin1String("/usr/bin/mdfind"); arguments = QStringList(QLatin1String("kMDItemCFBundleIdentifier == 'com.apple.dt.Xcode'")); launchServices.start(program, arguments, QProcess::ReadOnly); - if (!launchServices.waitForFinished() || launchServices.exitCode()) { + if (!launchServices.waitForFinished(-1) || launchServices.exitCode()) { qbsInfo() << Tr::tr("Could not detect additional Xcode installations with /usr/bin/mdfind"); } else { for (const QString &path : QString::fromLocal8Bit(launchServices.readAllStandardOutput()) diff --git a/src/lib/corelib/api/runenvironment.cpp b/src/lib/corelib/api/runenvironment.cpp index d803639a8..bf973cbc4 100644 --- a/src/lib/corelib/api/runenvironment.cpp +++ b/src/lib/corelib/api/runenvironment.cpp @@ -311,7 +311,7 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg << QStringLiteral("-t") // allow test packages << QStringLiteral("-d") // allow version code downgrade << targetBin); - if (!process.waitForFinished()) { + if (!process.waitForFinished(-1)) { if (process.error() == QProcess::FailedToStart) { throw ErrorInfo(Tr::tr("The process '%1' could not be started: %2") .arg(targetExecutable) @@ -351,7 +351,7 @@ int RunEnvironment::doRunTarget(const QString &targetBin, const QStringList &arg << StringConstants::simctlInstallCommand() << simulatorId << QDir::cleanPath(bundlePath)); - if (!process.waitForFinished()) { + if (!process.waitForFinished(-1)) { if (process.error() == QProcess::FailedToStart) { throw ErrorInfo(Tr::tr("The process '%1' could not be started: %2") .arg(targetExecutable) diff --git a/src/lib/corelib/tools/msvcinfo.cpp b/src/lib/corelib/tools/msvcinfo.cpp index 27e523d90..e390c9a30 100644 --- a/src/lib/corelib/tools/msvcinfo.cpp +++ b/src/lib/corelib/tools/msvcinfo.cpp @@ -101,7 +101,7 @@ static QByteArray runProcess(const QString &exeFilePath, const QStringList &args process.write(pipeData); process.closeWriteChannel(); } - if (!process.waitForFinished() || process.exitStatus() != QProcess::NormalExit) + if (!process.waitForFinished(-1) || process.exitStatus() != QProcess::NormalExit) throw ErrorInfo(mkStr("Could not run %1 (%2)").arg(exeFilePath, process.errorString())); if (process.exitCode() != 0 && !allowFailure) { ErrorInfo e(mkStr("Process '%1' failed with exit code %2.") |