Fix external sub-process runners to use line buffering

Previously the internal `system`/`systemStrict`/`stream` utilities were using
block buffering of the external process' standard input, which made them more
difficult to use interactively within `ghci`.
This commit is contained in:
Gabriel Gonzalez 2015-10-12 20:04:01 -07:00
parent 89d9e5e569
commit c30e41b00d

View file

@ -355,6 +355,7 @@ system p s = liftIO (do
let open = do let open = do
(Just hIn, Nothing, Nothing, ph) <- Process.createProcess p' (Just hIn, Nothing, Nothing, ph) <- Process.createProcess p'
IO.hSetBuffering hIn IO.LineBuffering
return (hIn, ph) return (hIn, ph)
-- Prevent double close -- Prevent double close
@ -389,6 +390,7 @@ systemStrict p s = liftIO (do
let open = do let open = do
(Just hIn, Just hOut, Nothing, ph) <- liftIO (Process.createProcess p') (Just hIn, Just hOut, Nothing, ph) <- liftIO (Process.createProcess p')
IO.hSetBuffering hIn IO.LineBuffering
return (hIn, hOut, ph) return (hIn, hOut, ph)
-- Prevent double close -- Prevent double close
@ -456,6 +458,7 @@ stream p s = do
let open = do let open = do
(Just hIn, Just hOut, Nothing, ph) <- liftIO (Process.createProcess p') (Just hIn, Just hOut, Nothing, ph) <- liftIO (Process.createProcess p')
IO.hSetBuffering hIn IO.LineBuffering
return (hIn, hOut, ph) return (hIn, hOut, ph)
-- Prevent double close -- Prevent double close