diff options
Diffstat (limited to 'Annex')
-rw-r--r-- | Annex/Content.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Annex/Content.hs b/Annex/Content.hs index c23d7e951..379ff0785 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -182,11 +182,11 @@ lockContent key a = do #ifndef mingw32_HOST_OS {- Since content files are stored with the write bit disabled, have - to fiddle with permissions to open for an exclusive lock. -} - lock contentfile Nothing = trylock $ liftIO $ - withModifiedFileMode contentfile - (`unionFileModes` ownerWriteMode) $ - maybe alreadylocked return - =<< tryLockExclusive Nothing contentfile + lock contentfile Nothing = trylock $ bracket_ + (thawContent contentfile) + (freezeContent contentfile) + (maybe alreadylocked return + =<< liftIO (tryLockExclusive Nothing contentfile)) lock _ (Just lockfile) = trylock $ do mode <- annexFileMode maybe alreadylocked return |