forked from qt-creator/qt-creator
SSH: Fix exit status/exit code interpretation
A "regular" exit of the ssh binary with exit code 255 means that the remote process has crashed. Change-Id: I82e6e44079041459e78e4f8f7e7b6e5cbcaa6c44 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
@@ -139,7 +139,7 @@ QProcess::ProcessState SshDeviceProcess::state() const
|
||||
|
||||
QProcess::ExitStatus SshDeviceProcess::exitStatus() const
|
||||
{
|
||||
return d->exitStatus == QSsh::SshRemoteProcess::NormalExit
|
||||
return d->exitStatus == QSsh::SshRemoteProcess::NormalExit && d->exitCode != 255
|
||||
? QProcess::NormalExit : QProcess::CrashExit;
|
||||
}
|
||||
|
||||
@@ -223,9 +223,9 @@ void SshDeviceProcess::handleProcessStarted()
|
||||
emit started();
|
||||
}
|
||||
|
||||
void SshDeviceProcess::handleProcessFinished()
|
||||
void SshDeviceProcess::handleProcessFinished(const QString &error)
|
||||
{
|
||||
d->errorMessage = d->process->errorString();
|
||||
d->errorMessage = error;
|
||||
d->exitCode = d->process->exitCode();
|
||||
d->setState(SshDeviceProcessPrivate::Inactive);
|
||||
emit finished();
|
||||
|
||||
Reference in New Issue
Block a user