Commit 817f99d3 authored by Thiago Macieira's avatar Thiago Macieira

Fix abuse of QProcess::error

It's invalid to call it if no previous function returned an error. Don't
rely on undefined behavior. Instead, simply check if waitForFinished()
returned false, which is what this code intended to do anyway.

Change-Id: I67903ba65e86ff1d1810481b2bd5724ab99a4b76
Reviewed-by: default avatarBogDan Vatra <bogdan@kde.org>
Reviewed-by: default avatarKurt Pattyn <pattyn.kurt@gmail.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 07da6325
......@@ -281,8 +281,7 @@ unsigned int AndroidDeployStep::remoteModificationTime(const QString &fullDestin
QStringList arguments = AndroidDeviceInfo::adbSelector(m_deviceSerialNumber);
arguments << QLatin1String("ls") << destination;
process.start(AndroidConfigurations::instance().adbToolPath().toString(), arguments);
process.waitForFinished(5000);
if (process.error() != QProcess::UnknownError
if (!process.waitForFinished(5000)
|| process.exitCode() != 0)
return -1;
QByteArray output = process.readAll();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment