summaryrefslogtreecommitdiff
path: root/src/Utility
diff options
context:
space:
mode:
authorJoey Hess2015-10-28 15:47:23 -0400
committerJoey Hess2015-10-28 15:47:23 -0400
commitd61e3866d794635de5875d7292861fb49ad0340a (patch)
tree962ce51ed61f47c99874bf746a9f7773f2b329cb /src/Utility
parent8c3d0d3a206520fb355334751cb2604a90d868bd (diff)
fix buffer order
Build it up reversed, and reverse when processing.
Diffstat (limited to 'src/Utility')
-rw-r--r--src/Utility/ConcurrentOutput.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Utility/ConcurrentOutput.hs b/src/Utility/ConcurrentOutput.hs
index 0f1cf9d3..5bf973de 100644
--- a/src/Utility/ConcurrentOutput.hs
+++ b/src/Utility/ConcurrentOutput.hs
@@ -248,7 +248,7 @@ outputDrainer ss fromh toh buf
go
_ -> atend
atend = do
- modifyMVar_ buf $ pure . (++ [(toh, ReachedEnd)])
+ modifyMVar_ buf $ pure . ((toh, ReachedEnd) :)
hClose fromh
-- Wait to lock output, and once we can, display everything
@@ -260,7 +260,7 @@ bufferWriter buf = lockOutput (go [stdout, stderr])
go [] = return ()
go hs = do
l <- takeMVar buf
- forM_ l $ \(h, ba) -> case ba of
+ forM_ (reverse l) $ \(h, ba) -> case ba of
Output b -> do
B.hPut h b
hFlush h