diff options
author | Joey Hess <joeyh@joeyh.name> | 2014-12-30 13:07:06 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2014-12-30 13:07:20 -0400 |
commit | 80d4481bf8ffed3c196c36d0d478c24b0cfd8cec (patch) | |
tree | b3e635bfe723ca2b29b91c83033030654010c35a /Remote/BitTorrent.hs | |
parent | 0cb5a895c59af8cb748a4c0b8e9c97efe785d441 (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.hs | 3 |
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 |