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
This commit is contained in:
parent
f53fb554fe
commit
8388427d23
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue