summaryrefslogtreecommitdiff
path: root/Remote/BitTorrent.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2014-12-30 13:07:06 -0400
committerJoey Hess <joeyh@joeyh.name>2014-12-30 13:07:20 -0400
commit6b3d0cb11a52ab36ce4b53b16bed2b86d77d2ae0 (patch)
treedcb1aded195aecf10601336d2f08501bc25b4421 /Remote/BitTorrent.hs
parent000fe26d44c97988332a40153dca25368d74e438 (diff)
bittorrent: Fix locking problem when using addurl file://
Fixes: /home/joey/tmp/xxx/.git/annex/misctmp/torrent18347: openFile: resource busy (file is locked)
Diffstat (limited to 'Remote/BitTorrent.hs')
-rw-r--r--Remote/BitTorrent.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Remote/BitTorrent.hs b/Remote/BitTorrent.hs
index 4e4b954460..d0a35fa307 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