From b89a790fcc6cd0385f6ad7f5256888c5af8f759c Mon Sep 17 00:00:00 2001 From: stolz Date: Thu, 5 Dec 2002 14:44:02 +0000 Subject: [PATCH] [project @ 2002-12-05 14:44:02 by stolz] Don't forget peeking signal handlers (nothing to see here, please move along) --- System/Posix/Signals.hsc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/System/Posix/Signals.hsc b/System/Posix/Signals.hsc index 8c44c2c..b55d2f4 100644 --- a/System/Posix/Signals.hsc +++ b/System/Posix/Signals.hsc @@ -280,15 +280,21 @@ installHandler int handler maybe_mask = do (#const STG_SIG_IGN) -> return Ignore (#const STG_SIG_ERR) -> throwErrno "installHandler" (#const STG_SIG_HAN) -> do - osptr <- peek p_sp - m <- deRefStablePtr osptr + m <- peekHandler p_sp return (Catch m) + (#const STG_SIG_RST) -> do + m <- peekHandler p_sp + return (CatchOnce m) install'' m p_sp mask int reset = do sptr <- newStablePtr m poke p_sp sptr stg_sig_install int reset p_sp mask + peekHandler p_sp = do + osptr <- peek p_sp + deRefStablePtr osptr + foreign import ccall unsafe stg_sig_install :: CInt -> CInt -> Ptr (StablePtr (IO ())) -> Ptr CSigset -> IO CInt -- 1.7.10.4