Commit 228297ec authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Drop redundant hFlush & add ignoreSigPipe to hClose

This is a follow-up to 79ae975a


(addressing #2233)
Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
parent d95a6701
......@@ -425,11 +425,11 @@ readProcess cmd args input = do
output <- hGetContents outh
withForkWait (C.evaluate $ rnf output) $ \waitOut -> do
-- now write and flush any input
unless (null input) $ do
-- now write any input
unless (null input) $
ignoreSigPipe $ hPutStr inh input
hFlush inh
hClose inh -- done with stdin
-- hClose performs implicit hFlush, and thus may trigger a SIGPIPE
ignoreSigPipe $ hClose inh
-- wait on the output
waitOut
......@@ -484,11 +484,11 @@ readProcessWithExitCode cmd args input = do
withForkWait (C.evaluate $ rnf out) $ \waitOut ->
withForkWait (C.evaluate $ rnf err) $ \waitErr -> do
-- now write and flush any input
unless (null input) $ do
-- now write any input
unless (null input) $
ignoreSigPipe $ hPutStr inh input
hFlush inh
hClose inh
-- hClose performs implicit hFlush, and thus may trigger a SIGPIPE
ignoreSigPipe $ hClose inh
-- wait on the output
waitOut
......
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