diff --git a/src/main/java/jnr/posix/util/SunMiscSignal.java b/src/main/java/jnr/posix/util/SunMiscSignal.java index e29c65c..4c550d9 100644 --- a/src/main/java/jnr/posix/util/SunMiscSignal.java +++ b/src/main/java/jnr/posix/util/SunMiscSignal.java @@ -10,8 +10,10 @@ public static SignalHandler signal(jnr.constants.platform.Signal sig, final Sign sun.misc.SignalHandler oldHandler = Signal.handle(s, new SunMiscSignalHandler(handler)); if (oldHandler instanceof SunMiscSignalHandler) { + // previous custom handler return ((SunMiscSignalHandler)oldHandler).handler; } else if (oldHandler != null) { + // default handler return any -> oldHandler.handle(s); } else { return null;