X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FExit.hs;h=146fdf55159c8bdb4b43240142f6248d513dee2e;hb=a2bcd1899dea9b266b7c795e391f658985deda2e;hp=23e6a6d9c8efd8a10dcffdb6e12883795f99f27e;hpb=4fc422dc9eda25fd202d03fa3b52c9a89f0cbe47;p=ghc-base.git diff --git a/System/Exit.hs b/System/Exit.hs index 23e6a6d..146fdf5 100644 --- a/System/Exit.hs +++ b/System/Exit.hs @@ -23,6 +23,7 @@ module System.Exit import Prelude #ifdef __GLASGOW_HASKELL__ +import GHC.Exception import GHC.IOBase #endif @@ -60,9 +61,9 @@ import System #ifndef __NHC__ exitWith :: ExitCode -> IO a -exitWith ExitSuccess = throwIO (ExitException ExitSuccess) +exitWith ExitSuccess = throwIO ExitSuccess exitWith code@(ExitFailure n) - | n /= 0 = throwIO (ExitException code) + | n /= 0 = throwIO code #ifdef __GLASGOW_HASKELL__ | otherwise = ioError (IOError Nothing InvalidArgument "exitWith" "ExitFailure 0" Nothing) #endif