Fix data loss that can occur when annex.pidlock is set in a repository.
This commit is contained in:
parent
2f48c0aa7c
commit
3e91cd13ba
3 changed files with 20 additions and 2 deletions
|
@ -47,8 +47,14 @@ tryLockExclusive :: Maybe FileMode -> LockFile -> Annex (Maybe LockHandle)
|
|||
tryLockExclusive m f = tryPidLock m f $ Posix.tryLockExclusive m f
|
||||
|
||||
checkLocked :: LockFile -> Annex (Maybe Bool)
|
||||
checkLocked f = Posix.checkLocked f
|
||||
`pidLockCheck` Pid.checkLocked
|
||||
checkLocked f = Posix.checkLocked f `pidLockCheck` checkpid
|
||||
where
|
||||
checkpid pidlock = do
|
||||
v <- Pid.checkLocked pidlock
|
||||
case v of
|
||||
-- Only return true when the posix lock file exists.
|
||||
Just _ -> Posix.checkLocked f
|
||||
Nothing -> return Nothing
|
||||
|
||||
getLockStatus :: LockFile -> Annex LockStatus
|
||||
getLockStatus f = Posix.getLockStatus f
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue