From 37da3113e7e5cac96ca5f02d0999a733483d6cae Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 18 Apr 2002 12:15:56 +0000 Subject: [PATCH] [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). --- ghc/utils/hsc2hs/Main.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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\ -- 1.7.10.4