summaryrefslogtreecommitdiff
path: root/src/plugins/remotelinux
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2019-06-24 15:36:20 +0200
committerChristian Kandeler <christian.kandeler@qt.io>2019-07-05 12:59:46 +0000
commit6fc7d158dfc17517db743bab21d2315a02109e63 (patch)
tree5112bf846491eace01df3db7c955db7a0a079c93 /src/plugins/remotelinux
parent68027ec41b2f33274602f321a1ab7fd81cc4acaa (diff)
downloadqt-creator-6fc7d158dfc17517db743bab21d2315a02109e63.tar.gz
RemoteLinux: Add missing check for stat failure
Task-number: QTCREATORBUG-22603 Change-Id: I5f5daefb039e48eb1983cf111859709233ca489a Reviewed-by: Tom Hall <tahall256@protonmail.ch> Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/remotelinux')
-rw-r--r--src/plugins/remotelinux/genericdirectuploadservice.cpp11
-rw-r--r--src/plugins/remotelinux/genericdirectuploadservice.h2
2 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/remotelinux/genericdirectuploadservice.cpp b/src/plugins/remotelinux/genericdirectuploadservice.cpp
index 84779d373e..5cf35e6e24 100644
--- a/src/plugins/remotelinux/genericdirectuploadservice.cpp
+++ b/src/plugins/remotelinux/genericdirectuploadservice.cpp
@@ -132,11 +132,12 @@ void GenericDirectUploadService::doDeploy()
}
QDateTime GenericDirectUploadService::timestampFromStat(const DeployableFile &file,
- SshRemoteProcess *statProc)
+ SshRemoteProcess *statProc,
+ const QString &errorMsg)
{
QString errorDetails;
- if (statProc->exitStatus() != QProcess::NormalExit)
- errorDetails = statProc->errorString();
+ if (!errorMsg.isEmpty())
+ errorDetails = errorMsg;
else if (statProc->exitCode() != 0)
errorDetails = QString::fromUtf8(statProc->readAllStandardError());
if (!errorDetails.isEmpty()) {
@@ -242,11 +243,11 @@ void GenericDirectUploadService::queryFiles()
SshRemoteProcess * const statProc = connection()->createRemoteProcess(statCmd).release();
statProc->setParent(this);
connect(statProc, &SshRemoteProcess::done, this,
- [this, statProc, state = d->state] {
+ [this, statProc, state = d->state](const QString &errorMsg) {
QTC_ASSERT(d->state == state, return);
const DeployableFile file = d->getFileForProcess(statProc);
QTC_ASSERT(file.isValid(), return);
- const QDateTime timestamp = timestampFromStat(file, statProc);
+ const QDateTime timestamp = timestampFromStat(file, statProc, errorMsg);
statProc->deleteLater();
switch (state) {
case PreChecking:
diff --git a/src/plugins/remotelinux/genericdirectuploadservice.h b/src/plugins/remotelinux/genericdirectuploadservice.h
index c41f8f99cc..9f8f6b70f7 100644
--- a/src/plugins/remotelinux/genericdirectuploadservice.h
+++ b/src/plugins/remotelinux/genericdirectuploadservice.h
@@ -62,7 +62,7 @@ public:
private:
QDateTime timestampFromStat(const ProjectExplorer::DeployableFile &file,
- QSsh::SshRemoteProcess *statProc);
+ QSsh::SshRemoteProcess *statProc, const QString &errorMsg);
void checkForStateChangeOnRemoteProcFinished();
QList<ProjectExplorer::DeployableFile> collectFilesToUpload(