diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-12-14 10:12:59 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-12-14 11:26:30 +0000 |
commit | a5cf6f194d79f67a99263cf7d6f07d41b79d5239 (patch) | |
tree | 33cdd354840bb3cd5db804b7f9fdf0b8be277878 /src/libs/ssh/sshremoteprocess.cpp | |
parent | 2710a9b0e57d7055cd1fcb81dd20ad51e1557fce (diff) |
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>
Diffstat (limited to 'src/libs/ssh/sshremoteprocess.cpp')
-rw-r--r-- | src/libs/ssh/sshremoteprocess.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp index 22e2813150..ca38f48b39 100644 --- a/src/libs/ssh/sshremoteprocess.cpp +++ b/src/libs/ssh/sshremoteprocess.cpp @@ -68,7 +68,12 @@ SshRemoteProcess::SshRemoteProcess(const QByteArray &command, const QStringList connect(this, static_cast<void (QProcess::*)(int, QProcess::ExitStatus)>(&QProcess::finished), [this] { - emit done(exitStatus() == QProcess::NormalExit ? QString() : errorString()); + QString error; + if (exitStatus() == QProcess::CrashExit) + error = tr("The ssh binary crashed: %1").arg(errorString()); + else if (exitCode() == 255) + error = tr("Remote process crashed."); + emit done(error); }); connect(this, &QProcess::errorOccurred, [this](QProcess::ProcessError error) { if (error == QProcess::FailedToStart) |