summaryrefslogtreecommitdiff
path: root/Remote/BitTorrent.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2014-12-30 13:07:06 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2014-12-30 13:07:20 -0400
commit80d4481bf8ffed3c196c36d0d478c24b0cfd8cec (patch)
treeb3e635bfe723ca2b29b91c83033030654010c35a /Remote/BitTorrent.hs
parent0cb5a895c59af8cb748a4c0b8e9c97efe785d441 (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 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