Commit a32d56ba authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Fix rawSystemStdin util function

Close the input after pushing it. Return any error message.
parent 5556d48d
......@@ -421,16 +421,11 @@ rawSystemStdin verbosity path args input = do
-- push all the input
hPutStr inh input
hClose inh
-- wait for the program to terminate
exitcode <- waitForProcess pid
unless (exitcode == ExitSuccess) $ do
debug verbosity $ path ++ " returned " ++ show exitcode
++ if null err then "" else
" with error message:\n" ++ err
exitWith exitcode
return ()
unless (exitcode == ExitSuccess) (die err)
tmpDir <- getTemporaryDirectory
withTempFile tmpDir ".cmd.stdin" $ \tmpName tmpHandle -> do
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment