From c008813becfa09162d249adbb4ae47f16e329d23 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 18 Nov 2014 16:36:34 -0400 Subject: close handles --- src/Propellor/CmdLine.hs | 12 ++++++++---- 1 file 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 -- cgit v1.2.3