diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-14 01:32:15 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2008-08-14 01:32:15 +0000 |
commit | 8388427d230e853466298cfae7abf0ac0af50269 (patch) | |
tree | eb9767b8d9c90a384af80ab5edcf847521864d61 /Text | |
parent | f53fb554fe0acf88d7c697236bbd1373e78f3d83 (diff) | |
download | pandoc-8388427d230e853466298cfae7abf0ac0af50269.tar.gz |
PDF writer: Close output file handle after waitForProcess.
It should be closed automatically, but perhaps this fails on Windows,
especially when the process is interrupted?
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1410 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'Text')
-rw-r--r-- | Text/Pandoc/PDF.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Text/Pandoc/PDF.hs b/Text/Pandoc/PDF.hs index dc8e49df1..4257e4712 100644 --- a/Text/Pandoc/PDF.hs +++ b/Text/Pandoc/PDF.hs @@ -37,7 +37,7 @@ import System.Exit import System.Environment ( getEnvironment ) import Text.Pandoc.Shared ( withTempDir ) import Prelude hiding ( writeFile, readFile, putStrLn ) -import System.IO ( stderr, openFile, IOMode (..) ) +import System.IO ( stderr, openFile, IOMode (..), hClose ) #ifdef _UTF8STRING import System.IO.UTF8 #else @@ -102,6 +102,7 @@ runProgram cmdPath arguments workingDir env = do runOutput <- openFile runOutputPath WriteMode ph <- runProcess cmdPath arguments (Just workingDir) (Just env) Nothing (Just runOutput) (Just runOutput) ec <- waitForProcess ph -- requires compilation with -threaded + hClose runOutput case ec of ExitSuccess -> return [] _ -> do |