mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Post-review cleanup (IDEA-CR-51912)
GitOrigin-RevId: b160f233e3f4d1a2f96f0d67b0c4a5d7f130c27f
This commit is contained in:
committed by
intellij-monorepo-bot
parent
11c3a44d4d
commit
086de7bfc1
@@ -3,6 +3,7 @@ package com.intellij.ide;
|
||||
|
||||
import com.intellij.concurrency.JobScheduler;
|
||||
import com.intellij.diagnostic.VMOptions;
|
||||
import com.intellij.execution.process.UnixProcessManager;
|
||||
import com.intellij.ide.actions.EditCustomVmOptionsAction;
|
||||
import com.intellij.ide.util.PropertiesComponent;
|
||||
import com.intellij.jna.JnaLoader;
|
||||
@@ -105,17 +106,17 @@ final class SystemHealthMonitor extends PreloadingActivity {
|
||||
try {
|
||||
Memory sa = new Memory(256);
|
||||
|
||||
if (LibC.sigaction(LibC.SIGINT, Pointer.NULL, sa) == 0 && LibC.SIG_IGN.equals(sa.getPointer(0))) {
|
||||
LibC.Handler newHandler = sig -> { System.exit(130); }; // 128 + SIGINT (ref: java.lang.Terminator)
|
||||
if (LibC.sigaction(UnixProcessManager.SIGINT, Pointer.NULL, sa) == 0 && LibC.SIG_IGN.equals(sa.getPointer(0))) {
|
||||
LibC.Handler newHandler = sig -> { System.exit(128 + sig); }; // ref: java.lang.Terminator
|
||||
SIGINT_CALLBACK_REF = newHandler;
|
||||
LibC.signal(LibC.SIGINT, newHandler);
|
||||
LibC.signal(UnixProcessManager.SIGINT, newHandler);
|
||||
LOG.info("restored ignored INT handler");
|
||||
}
|
||||
|
||||
if (LibC.sigaction(LibC.SIGPIPE, Pointer.NULL, sa) == 0 && LibC.SIG_IGN.equals(sa.getPointer(0))) {
|
||||
if (LibC.sigaction(UnixProcessManager.SIGPIPE, Pointer.NULL, sa) == 0 && LibC.SIG_IGN.equals(sa.getPointer(0))) {
|
||||
LibC.Handler newHandler = sig -> { }; // no-op handler unmasks the signal in child processes
|
||||
SIGPIPE_CALLBACK_REF = newHandler;
|
||||
LibC.signal(LibC.SIGPIPE, newHandler);
|
||||
LibC.signal(UnixProcessManager.SIGPIPE, newHandler);
|
||||
LOG.info("restored ignored PIPE handler");
|
||||
}
|
||||
}
|
||||
@@ -241,9 +242,6 @@ final class SystemHealthMonitor extends PreloadingActivity {
|
||||
Native.register(LibC.class, NativeLibrary.getInstance("c"));
|
||||
}
|
||||
|
||||
static final int SIGINT = 2;
|
||||
static final int SIGPIPE = 13;
|
||||
|
||||
static final Pointer SIG_IGN = new Pointer(1L);
|
||||
|
||||
interface Handler extends Callback {
|
||||
|
||||
@@ -29,9 +29,11 @@ import static com.intellij.util.ObjectUtils.assertNotNull;
|
||||
public class UnixProcessManager {
|
||||
private static final Logger LOG = Logger.getInstance(UnixProcessManager.class);
|
||||
|
||||
public static final int SIGINT = getSignalNumber("INT");
|
||||
public static final int SIGKILL = getSignalNumber("KILL");
|
||||
public static final int SIGTERM = getSignalNumber("TERM");
|
||||
// https://en.wikipedia.org/wiki/Signal_(IPC)#POSIX_signals
|
||||
public static final int SIGINT = 2;
|
||||
public static final int SIGKILL = 9;
|
||||
public static final int SIGTERM = 15;
|
||||
public static final int SIGPIPE = getSignalNumber("PIPE");
|
||||
|
||||
private interface CLib extends Library {
|
||||
int getpid();
|
||||
|
||||
Reference in New Issue
Block a user