summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2002-04-04 08:49:46 +0000
committersimonmar <unknown>2002-04-04 08:49:46 +0000
commitec7a80bff8bf33232a1b48b9d814648db8ca5fda (patch)
treeb7bf5f6b7a1ff79d691b8544e4e8059a0422e75e
parent9225429937efa2e6b54ba254721fad7391081eef (diff)
downloadhaskell-ec7a80bff8bf33232a1b48b9d814648db8ca5fda.tar.gz
[project @ 2002-04-04 08:49:46 by simonmar]
An I/O error while opening/writing the output file is *not* a panic.
-rw-r--r--ghc/compiler/main/CodeOutput.lhs7
1 files changed, 1 insertions, 6 deletions
diff --git a/ghc/compiler/main/CodeOutput.lhs b/ghc/compiler/main/CodeOutput.lhs
index 9e0dada123..166c0990e6 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}