Skip to content
Snippets Groups Projects
Commit dd951f2c authored by sof's avatar sof
Browse files

[project @ 1999-07-03 18:43:46 by sof]

exitWith: don't call exit(), but use the RTS' shutdownHaskellAndExit()
parent d1a47b32
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
\section[System]{Module @System@} \section[System]{Module @System@}
\begin{code} \begin{code}
{-# OPTIONS -#include "cbits/stgio.h" #-} {-# OPTIONS -#include "cbits/stgio.h" -#include "RtsAPI.h" #-}
module System module System
( (
ExitCode(ExitSuccess,ExitFailure) ExitCode(ExitSuccess,ExitFailure)
...@@ -142,7 +142,7 @@ exitWith (ExitFailure n) ...@@ -142,7 +142,7 @@ exitWith (ExitFailure n)
primExit n primExit n
ioError (IOError Nothing OtherError "exitWith" "exit should not return") ioError (IOError Nothing OtherError "exitWith" "exit should not return")
foreign import ccall "libHS_cbits.so" "exit" unsafe primExit :: Int -> IO () foreign import ccall "shutdownHaskellAndExit" primExit :: Int -> IO ()
exitFailure :: IO a exitFailure :: IO a
exitFailure = exitWith (ExitFailure 1) exitFailure = exitWith (ExitFailure 1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment