summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-04-03 19:48:56 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-04-03 19:48:56 -0400
commitc4218e0ffed77e2afaafc8efd19efd907a6abd8a (patch)
treefc57ba589bdd3288438206a135b19f79328dad3b
parentd660e2443b99817a33127443e5d7314c99c291fc (diff)
fix stderr handling
-rw-r--r--Messages/Progress.hs4
-rw-r--r--Utility/Process.hs1
2 files changed, 3 insertions, 2 deletions
diff --git a/Messages/Progress.hs b/Messages/Progress.hs
index 60ab8271a..c9a7cfda8 100644
--- a/Messages/Progress.hs
+++ b/Messages/Progress.hs
@@ -61,8 +61,8 @@ mkProgressHandler meter = ProgressHandler
quietmode = withOutputType $ \t -> return $ case t of
ProgressOutput -> True
_ -> False
- stderrhandler emitter h = do
- void $ emitter =<< hGetLine stderr
+ stderrhandler emitter h = unlessM (hIsEOF h) $ do
+ void $ emitter =<< hGetLine h
stderrhandler emitter h
{- Generates an IO action that can be used to emit stderr.
diff --git a/Utility/Process.hs b/Utility/Process.hs
index 64363cf6b..0f494810c 100644
--- a/Utility/Process.hs
+++ b/Utility/Process.hs
@@ -321,6 +321,7 @@ stderrHandle _ = error "expected stderrHandle"
ioHandles :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> (Handle, Handle)
ioHandles (Just hin, Just hout, _, _) = (hin, hout)
ioHandles _ = error "expected ioHandles"
+oeHandles :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> (Handle, Handle)
oeHandles (_, Just hout, Just herr, _) = (hout, herr)
oeHandles _ = error "expected oeHandles"