SshProcessInterface: Don't use DeviceShell for control signals

It looks like starting device shell is fragile in some
circumstances.

Fixes: QTCREATORBUG-28072
Change-Id: I1a51d1fb939bd42884a55e1492de808bee89219f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Jarek Kobus
2022-11-09 19:29:41 +01:00
parent 8bbeef1f98
commit f8a3a4d04e

View File

@@ -483,7 +483,17 @@ qint64 SshProcessInterface::processId() const
bool SshProcessInterface::runInShell(const CommandLine &command, const QByteArray &data)
{
return d->m_devicePrivate->runInShell(command, data).exitCode == 0;
QtcProcess process;
CommandLine cmd = {d->m_device->filePath("/bin/sh"), {"-c"}};
QString tmp;
ProcessArgs::addArg(&tmp, command.executable().path());
ProcessArgs::addArgs(&tmp, command.arguments());
cmd.addArg(tmp);
process.setCommand(cmd);
process.setWriteData(data);
process.start();
QTC_CHECK(process.waitForFinished()); // otherwise we may start producing killers for killers
return process.exitCode() == 0;
}
void SshProcessInterface::start()