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

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 <>
Reviewed-by: default avatarKurt Pattyn <>
Reviewed-by: default avatarDaniel Teske <>
parent 07da6325
...@@ -281,8 +281,7 @@ unsigned int AndroidDeployStep::remoteModificationTime(const QString &fullDestin ...@@ -281,8 +281,7 @@ unsigned int AndroidDeployStep::remoteModificationTime(const QString &fullDestin
QStringList arguments = AndroidDeviceInfo::adbSelector(m_deviceSerialNumber); QStringList arguments = AndroidDeviceInfo::adbSelector(m_deviceSerialNumber);
arguments << QLatin1String("ls") << destination; arguments << QLatin1String("ls") << destination;
process.start(AndroidConfigurations::instance().adbToolPath().toString(), arguments); process.start(AndroidConfigurations::instance().adbToolPath().toString(), arguments);
process.waitForFinished(5000); if (!process.waitForFinished(5000)
if (process.error() != QProcess::UnknownError
|| process.exitCode() != 0) || process.exitCode() != 0)
return -1; return -1;
QByteArray output = process.readAll(); QByteArray output = process.readAll();
Supports Markdown
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