avoid annexFileMode special case
This makes annexFileMode be just an application of setAnnexPerm', which avoids having 2 functions that do different versions of the same thing. Fixes some buggy behavior for some combinations of core.sharedRepository and umask. Sponsored-by: Jack Hill on Patreon
This commit is contained in:
parent
67f8268b3f
commit
aff37fc208
13 changed files with 82 additions and 69 deletions
|
@ -83,8 +83,7 @@ trySideLock :: PidLockFile -> (SideLockHandle -> IO a) -> IO a
|
|||
trySideLock lockfile a = do
|
||||
sidelock <- sideLockFile lockfile
|
||||
mlck <- catchDefaultIO Nothing $
|
||||
withUmask nullFileMode $
|
||||
Posix.tryLockExclusive (Just mode) sidelock
|
||||
Posix.tryLockExclusive (Just modesetter) sidelock
|
||||
-- Check the lock we just took, in case we opened a side lock file
|
||||
-- belonging to another process that will have since deleted it.
|
||||
case mlck of
|
||||
|
@ -100,6 +99,7 @@ trySideLock lockfile a = do
|
|||
-- delete another user's lock file there, so could not
|
||||
-- delete a stale lock.
|
||||
mode = combineModes (readModes ++ writeModes)
|
||||
modesetter = ModeSetter mode (\f -> modifyFileMode f (const mode))
|
||||
|
||||
dropSideLock :: SideLockHandle -> IO ()
|
||||
dropSideLock Nothing = return ()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue