From 80d4481bf8ffed3c196c36d0d478c24b0cfd8cec Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 30 Dec 2014 13:07:06 -0400 Subject: bittorrent: Fix locking problem when using addurl file:// Fixes: /home/joey/tmp/xxx/.git/annex/misctmp/torrent18347: openFile: resource busy (file is locked) --- Remote/BitTorrent.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Remote') diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs index 4e4b95446..d0a35fa30 100644 --- a/Remote/BitTorrent.hs +++ b/Remote/BitTorrent.hs @@ -200,7 +200,8 @@ downloadTorrentFile u = do return ok else do misctmp <- fromRepo gitAnnexTmpMiscDir - withTmpFileIn misctmp "torrent" $ \f _h -> do + withTmpFileIn misctmp "torrent" $ \f h -> do + liftIO $ hClose h ok <- Url.withUrlOptions $ Url.download u f when ok $ liftIO $ renameFile f torrent -- cgit v1.2.3