diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-10-28 15:47:23 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-10-28 15:47:23 -0400 |
| commit | d61e3866d794635de5875d7292861fb49ad0340a (patch) | |
| tree | 962ce51ed61f47c99874bf746a9f7773f2b329cb /src | |
| parent | 8c3d0d3a206520fb355334751cb2604a90d868bd (diff) | |
fix buffer order
Build it up reversed, and reverse when processing.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Utility/ConcurrentOutput.hs | 4 |
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 |
