RemoteLinux: Fix off-by-one error for stat %Y last modified column

The -t parameter on GNU stat uses the format:
%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %W %o

The -t parameter on BusyBox stat uses the format:
%n %s %b %f %u %g %D %i %h %t %T %X %Y %Z %o

BusyBox doesn't support %W so it is not included when using -t.

It was incorrectly referring to %Z (time of last status change, seconds
since Epoch) because it did not take into account the first column being
removed. Subtract 1 from the index so that it takes this into account
and correctly refers to %Y (time of last data modification, seconds
since Epoch).

Task-number: QTCREATORBUG-22041
Change-Id: I272609facbd8148199d2bfcf6f5adbdc273a6b50
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Jonathan Liu
2019-04-26 13:43:54 +10:00
parent e5ecb0220e
commit 3284c6c6f3

View File

@@ -158,7 +158,7 @@ QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &fi
return QDateTime(); return QDateTime();
} }
bool isNumber; bool isNumber;
const qint64 secsSinceEpoch = columns.at(12).toLongLong(&isNumber); const qint64 secsSinceEpoch = columns.at(11).toLongLong(&isNumber);
if (!isNumber) { if (!isNumber) {
emit warningMessage(warningString); emit warningMessage(warningString);
return QDateTime(); return QDateTime();