RemoteLinux: Do not try to kill a non-existing process

After sending SIGTERM, check whether the process is still running before
sending SIGKILL.

Fixes: QTCREATORBUG-19941
Change-Id: I16953fbe1690373990f8a8fe723572b2125b59d3
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2018-12-13 12:33:20 +01:00
parent d7178b88c4
commit be4bd1dc06

View File

@@ -94,8 +94,10 @@ QString RemoteLinuxSignalOperation::interruptProcessByNameCommandLine(const QStr
void RemoteLinuxSignalOperation::killProcess(qint64 pid)
{
run(QString::fromLatin1("%1; sleep 1; %2").arg(signalProcessGroupByPidCommandLine(pid, 15),
signalProcessGroupByPidCommandLine(pid, 9)));
run(QString::fromLatin1("%1; sleep 1; %2 && %3")
.arg(signalProcessGroupByPidCommandLine(pid, 15),
signalProcessGroupByPidCommandLine(pid, 0),
signalProcessGroupByPidCommandLine(pid, 9)));
}
void RemoteLinuxSignalOperation::killProcess(const QString &filePath)