From 0d5123633d8a9da1670b7b348d4c5def133d9d45 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 11 Sep 2014 13:53:26 -0400 Subject: Fix transfer lock file FD leak that could occur when two separate git-annex processes were both working to perform the same set of transfers. --- Annex/Transfer.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Annex/Transfer.hs') diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs index 448b5b3d7..d33d3073b 100644 --- a/Annex/Transfer.hs +++ b/Annex/Transfer.hs @@ -85,7 +85,9 @@ runTransfer' ignorelock t file shouldretry a = do locked <- catchMaybeIO $ setLock fd (WriteLock, AbsoluteSeek, 0, 0) if isNothing locked - then return (Nothing, True) + then do + closeFd fd + return (Nothing, True) else do void $ tryIO $ writeTransferInfoFile info tfile return (mfd, False) -- cgit v1.2.3