diff options
author | Joey Hess <joey@kitenet.net> | 2014-03-12 13:54:29 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-03-12 13:54:29 -0400 |
commit | 4d79d2327819111f97954e10dce2c8ce53b0ab31 (patch) | |
tree | 6ecd92e8f5e7dd2a2865586234d6623a249e76e1 /Git | |
parent | 929a4f5e0af5071af17a16e08995c43c1570daae (diff) |
read stdout and stderr concurrently
Avoids any buffering-related blocking.
Diffstat (limited to 'Git')
-rw-r--r-- | Git/Fsck.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Git/Fsck.hs b/Git/Fsck.hs index b3948cb1d..e8fa02129 100644 --- a/Git/Fsck.hs +++ b/Git/Fsck.hs @@ -24,6 +24,7 @@ import qualified Git.Version import qualified Data.Set as S import System.Process (std_out, std_err) +import Control.Concurrent.Async type MissingObjects = S.Set Sha @@ -53,8 +54,9 @@ findBroken batchmode r = do { std_out = CreatePipe , std_err = CreatePipe } - bad1 <- readMissingObjs r supportsNoDangling (stdoutHandle p) - bad2 <- readMissingObjs r supportsNoDangling (stderrHandle p) + (bad1, bad2) <- concurrently + (readMissingObjs r supportsNoDangling (stdoutHandle p)) + (readMissingObjs r supportsNoDangling (stderrHandle p)) fsckok <- checkSuccessProcess pid let badobjs = S.union bad1 bad2 |