From: simonmar Date: Thu, 18 Apr 2002 12:15:56 +0000 (+0000) Subject: [project @ 2002-04-18 12:15:56 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~2143 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=37da3113e7e5cac96ca5f02d0999a733483d6cae;p=ghc-hetmet.git [project @ 2002-04-18 12:15:56 by simonmar] Check the exit status of the generated C program when we run it, and exit if it failed (partly from Axel Simon). --- diff --git a/ghc/utils/hsc2hs/Main.hs b/ghc/utils/hsc2hs/Main.hs index 00ff523..95aae88 100644 --- a/ghc/utils/hsc2hs/Main.hs +++ b/ghc/utils/hsc2hs/Main.hs @@ -1,5 +1,5 @@ ------------------------------------------------------------------------ --- $Id: Main.hs,v 1.37 2002/02/13 10:39:36 simonpj Exp $ +-- $Id: Main.hs,v 1.38 2002/04/18 12:15:56 simonmar Exp $ -- -- Program for converting .hsc files to .hs files, by converting the -- file into a C program which is run to generate the Haskell source. @@ -516,8 +516,11 @@ output flags name toks = do _ -> return () removeFile oProgName - system (execProgName++" >"++outName) + progStatus <- system (execProgName++" >"++outName) removeFile progName + case progStatus of + e@(ExitFailure _) -> exitWith e + _ -> return () when needsH $ writeFile outHName $ "#ifndef "++includeGuard++"\n\