diff options
| author | Joey Hess <joey@kitenet.net> | 2014-11-18 16:36:34 -0400 |
|---|---|---|
| committer | Joey Hess <joey@kitenet.net> | 2014-11-18 16:36:43 -0400 |
| commit | c008813becfa09162d249adbb4ae47f16e329d23 (patch) | |
| tree | c35bda92e8af004399185300ada60258515e0b38 /src/Propellor | |
| parent | efa5b12516510b53d873fd44be9d2d1f13391672 (diff) | |
close handles
Diffstat (limited to 'src/Propellor')
| -rw-r--r-- | src/Propellor/CmdLine.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 293bf3a2..8591395d 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -325,10 +325,14 @@ gitPush hin hout = void $ fromstdin `concurrently` tostdout connect fromh toh = do b <- B.hGetSome fromh 40960 hPutStrLn stderr $ show ("from", fromh, "to", toh, b) - unless (B.null b) $ do - B.hPut toh b - hFlush toh - connect fromh toh + if B.null b + then do + hClose fromh + hClose toh + else do + B.hPut toh b + hFlush toh + connect fromh toh hasOrigin :: IO Bool hasOrigin = do |
