From: simonmar Date: Thu, 4 Apr 2002 08:49:46 +0000 (+0000) Subject: [project @ 2002-04-04 08:49:46 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~2180 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ec7a80bff8bf33232a1b48b9d814648db8ca5fda;p=ghc-hetmet.git [project @ 2002-04-04 08:49:46 by simonmar] An I/O error while opening/writing the output file is *not* a panic. --- diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs index 9e0dada..166c099 100644 --- a/ghc/compiler/main/CodeOutput.lhs +++ b/ghc/compiler/main/CodeOutput.lhs @@ -93,12 +93,7 @@ codeOutput dflags mod_name tycons core_binds stg_binds } doOutput :: String -> (Handle -> IO ()) -> IO () -doOutput filenm io_action - = (do handle <- openFile filenm WriteMode - io_action handle - hClose handle) - `catch` (\err -> pprPanic "Failed to open or write code output file" - (text filenm)) +doOutput filenm io_action = bracket (openFile filenm WriteMode) hClose io_action \end{code}