bittorrent: Fix locking problem when using addurl file://
Fixes: /home/joey/tmp/xxx/.git/annex/misctmp/torrent18347: openFile: resource busy (file is locked)
This commit is contained in:
parent
000fe26d44
commit
6b3d0cb11a
2 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue