diff options
author | Joey Hess <joey@kitenet.net> | 2012-04-21 16:59:49 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-04-21 19:36:03 -0400 |
commit | b98b69e8c6d9b873a864b79cff857882f67ee576 (patch) | |
tree | 4ae145f9fe34c5e71424ab3d12dca6ab8070ce41 /Annex/LockPool.hs | |
parent | 7e45712d194aa2b231083c3ccee3668f053e5717 (diff) |
honor core.sharedRepository when making all the other files in the annex
Lock files, directories, etc.
Diffstat (limited to 'Annex/LockPool.hs')
-rw-r--r-- | Annex/LockPool.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Annex/LockPool.hs b/Annex/LockPool.hs index 3fede5739..3eb1363ee 100644 --- a/Annex/LockPool.hs +++ b/Annex/LockPool.hs @@ -12,6 +12,7 @@ import System.Posix.Types (Fd) import Common.Annex import Annex +import Annex.Perms {- Create a specified lock file, and takes a shared lock. -} lockFile :: FilePath -> Annex () @@ -19,7 +20,9 @@ lockFile file = go =<< fromPool file where go (Just _) = return () -- already locked go Nothing = do - fd <- liftIO $ openFd file ReadOnly (Just stdFileMode) defaultFileFlags + mode <- annexFileMode + fd <- liftIO $ noUmask mode $ + openFd file ReadOnly (Just mode) defaultFileFlags liftIO $ waitToSetLock fd (ReadLock, AbsoluteSeek, 0, 0) changePool $ M.insert file fd |