add missing checkSaneLock wrapper for pidlocks
This commit is contained in:
parent
e2b4861bff
commit
262c37c16e
2 changed files with 7 additions and 2 deletions
|
@ -24,9 +24,10 @@ import Common.Annex
|
|||
import qualified Annex
|
||||
import qualified Utility.LockPool.Posix as Posix
|
||||
import qualified Utility.LockPool.PidLock as Pid
|
||||
import qualified Utility.LockPool.LockHandle as H
|
||||
import Utility.LockPool.LockHandle (LockHandle, dropLock)
|
||||
import Utility.LockFile.Posix (openLockFile)
|
||||
import Utility.LockPool.STM (LockFile)
|
||||
import Utility.LockPool.LockHandle
|
||||
import Utility.LockFile.LockStatus
|
||||
|
||||
import System.Posix
|
||||
|
@ -51,6 +52,10 @@ getLockStatus :: LockFile -> Annex LockStatus
|
|||
getLockStatus f = Posix.getLockStatus f
|
||||
`pidLockCheck` Pid.getLockStatus
|
||||
|
||||
checkSaneLock :: LockFile -> LockHandle -> Annex Bool
|
||||
checkSaneLock f h = H.checkSaneLock f h
|
||||
`pidLockCheck` flip Pid.checkSaneLock h
|
||||
|
||||
pidLockFile :: Annex (Maybe FilePath)
|
||||
pidLockFile = ifM (annexPidLock <$> Annex.getGitConfig)
|
||||
( Just <$> fromRepo gitAnnexPidLockFile
|
||||
|
|
|
@ -96,7 +96,7 @@ runTransfer' ignorelock t file shouldretry transferobserver transferaction = do
|
|||
r <- tryLockExclusive (Just mode) lck
|
||||
case r of
|
||||
Nothing -> return (Nothing, True)
|
||||
Just lockhandle -> ifM (liftIO $ checkSaneLock lck lockhandle)
|
||||
Just lockhandle -> ifM (checkSaneLock lck lockhandle)
|
||||
( do
|
||||
void $ liftIO $ tryIO $
|
||||
writeTransferInfoFile info tfile
|
||||
|
|
Loading…
Reference in a new issue