mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Allow specifying our PID when sending signal to process tree
This allows to send signals to processes which weren't started as direct children of the IDE process. Used in Rider.
This commit is contained in:
@@ -115,7 +115,11 @@ public class UnixProcessManager {
|
||||
public static boolean sendSignalToProcessTree(int processId, int signal) {
|
||||
checkCLib();
|
||||
|
||||
final int our_pid = C_LIB.getpid();
|
||||
final int ourPid = C_LIB.getpid();
|
||||
return sendSignalToProcessTree(processId, signal, ourPid);
|
||||
}
|
||||
|
||||
public static boolean sendSignalToProcessTree(int processId, int signal, int ourPid) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Sending signal " + signal + " to process tree with root PID " + processId);
|
||||
}
|
||||
@@ -124,7 +128,7 @@ public class UnixProcessManager {
|
||||
final ProcessInfo processInfo = new ProcessInfo();
|
||||
final List<Integer> childrenPids = new ArrayList<Integer>();
|
||||
|
||||
findChildProcesses(our_pid, processId, foundPid, processInfo, childrenPids);
|
||||
findChildProcesses(ourPid, processId, foundPid, processInfo, childrenPids);
|
||||
|
||||
// result is true if signal was sent to at least one process
|
||||
final boolean result;
|
||||
|
||||
Reference in New Issue
Block a user