From: simonmar Date: Tue, 15 Aug 2000 11:56:08 +0000 (+0000) Subject: [project @ 2000-08-15 11:56:08 by simonmar] X-Git-Tag: Approximately_9120_patches~3886 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=87c0d8c15abc3004aa08c429e62f74e25e8d0c64;p=ghc-hetmet.git [project @ 2000-08-15 11:56:08 by simonmar] fail properly in ghcExit, now that we don't call error any more. --- diff --git a/ghc/compiler/main/ErrUtils.lhs b/ghc/compiler/main/ErrUtils.lhs index 7e6e181..db0c997 100644 --- a/ghc/compiler/main/ErrUtils.lhs +++ b/ghc/compiler/main/ErrUtils.lhs @@ -20,6 +20,8 @@ import Bag ( Bag, bagToList, isEmptyBag ) import SrcLoc ( SrcLoc, noSrcLoc ) import Util ( sortLt ) import Outputable + +import System ( ExitCode(..), exitWith ) import IO ( hPutStr, stderr ) \end{code} @@ -83,11 +85,10 @@ pprBagOfWarnings bag_of_warns = pprBagOfErrors bag_of_warns \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}