1
0
forked from GitHub/gf-core

Block SIGINT while running gfInteract, as suggested by Peter.

This commit is contained in:
bringert
2006-06-15 01:41:18 +00:00
parent 17f5fad35d
commit 6bd400091c
4 changed files with 16 additions and 4 deletions

View File

@@ -48,3 +48,11 @@ runInterruptibly a =
-- the computation fails or not.
runInterruptibly_ :: IO () -> IO ()
runInterruptibly_ = fmap (either (const ()) id) . runInterruptibly
-- | Run an action with SIGINT blocked.
blockInterrupt :: IO a -> IO a
blockInterrupt a =
do oldH <- installHandler sigINT Ignore Nothing
x <- a
installHandler sigINT oldH Nothing
return x