import SrcLoc ( SrcLoc, noSrcLoc )
import Util ( sortLt )
import Outputable
+
+import System ( ExitCode(..), exitWith )
import IO ( hPutStr, stderr )
\end{code}
\begin{code}
ghcExit :: Int -> IO ()
-
ghcExit val
- = if val /= 0
- then hPutStr stderr "\nCompilation had errors\n\n"
- else return ()
+ | val == 0 = exitWith ExitSuccess
+ | otherwise = do hPutStr stderr "\nCompilation had errors\n\n"
+ exitWith (ExitFailure val)
\end{code}
\begin{code}