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 | 6b3d0cb11a52ab36ce4b53b16bed2b86d77d2ae0 (patch) | |
tree | dcb1aded195aecf10601336d2f08501bc25b4421 /Remote/BitTorrent.hs | |
parent | 000fe26d44c97988332a40153dca25368d74e438 (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 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 |