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 | |
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)
-rw-r--r-- | Remote/BitTorrent.hs | 3 | ||||
-rw-r--r-- | debian/changelog | 1 |
2 files changed, 3 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 diff --git a/debian/changelog b/debian/changelog index cead4170f..e3bf961c2 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ git-annex (5.20141220) UNRELEASED; urgency=medium * Run shutdown cleanup actions even if there were failures processing the command. Amoung other fixes, this means that addurl will stage added files even if adding one of the urls fails. + * bittorrent: Fix locking problem when using addurl file:// -- Joey Hess <id@joeyh.name> Mon, 22 Dec 2014 15:16:38 -0400 |