Created
December 29, 2008 15:53
-
-
Save smly/41294 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Posix.Unistd | |
import System.Posix.Signals | |
import System.Exit | |
main = do | |
let exit0 = exitWith ExitSuccess | |
let exit1 = exitWith (ExitFailure 1) | |
installHandler sigINT (Catch exit1) Nothing | |
sleep 1000000 | |
exit0 | |
{- | |
result: | |
http://gyazo.com/f454e3d519c1ff7170d5cb824afc4edd.png | |
-} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment