Utils: Fix interrupting local processes on *nix

Change-Id: I6e722379ad62c98d1e8e6d445c1eeea171ff141b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
This commit is contained in:
hjk
2022-11-15 09:25:16 +01:00
parent ef658663aa
commit 779dc52a97
2 changed files with 4 additions and 3 deletions

View File

@@ -10,7 +10,9 @@
#include <qt_windows.h>
#else
#include <errno.h>
#include <signal.h>
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#endif
@@ -127,7 +129,7 @@ void ProcessHelper::interruptPid(qint64 pid)
#ifdef Q_OS_WIN
EnumWindows(sendInterruptMessageToAllWindowsOfProcess_enumWnd, pid);
#else
Q_UNUSED(pid)
::kill(pid, SIGINT);
#endif
}

View File

@@ -459,8 +459,7 @@ private:
m_handle->kill();
break;
case ControlSignal::Interrupt:
if (m_setup.m_useCtrlCStub) // bypass launcher and interrupt directly
ProcessHelper::interruptPid(m_handle->processId());
ProcessHelper::interruptPid(m_handle->processId());
break;
case ControlSignal::KickOff:
QTC_CHECK(false);