summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2015-10-28 13:17:39 -0400
committerJoey Hess2015-10-28 13:17:39 -0400
commit8579d5c5c436cffca56506cd6c52f90d64b082ce (patch)
treef298357d0590391740442e65b9de4237eeb6f7ad
parent6179ad56d9537e0aa972dfa3e60b01b5cfc71c1b (diff)
propellor spin
-rw-r--r--src/Utility/ConcurrentOutput.hs9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/Utility/ConcurrentOutput.hs b/src/Utility/ConcurrentOutput.hs
index 20e39832..279421e2 100644
--- a/src/Utility/ConcurrentOutput.hs
+++ b/src/Utility/ConcurrentOutput.hs
@@ -116,6 +116,7 @@ updateOutputLocker l = do
lcker <- outputLockedBy <$> getOutputHandle
void $ tryTakeMVar lcker
putMVar lcker l
+ modifyMVar_ lcker (const $ return l)
-- | Use this around any IO actions that use `outputConcurrent`
-- or `createProcessConcurrent`
@@ -169,15 +170,11 @@ createProcessConcurrent p
firstprocess
, do
lcker <- outputLockedBy <$> getOutputHandle
- l <- tryReadMVar lcker
- hPutStrLn stderr $ show ("IS CONCURRENT", cmd, l)
+ hPutStrLn stderr $ show ("IS CONCURRENT", cmd)
hFlush stderr
concurrentprocess
)
- | otherwise = do
- hPutStrLn stderr $ show ("NO OUTPUT", cmd)
- hFlush stderr
- P.createProcess p
+ | otherwise = P.createProcess p
where
willoutput P.Inherit = True
willoutput _ = False