add missing checkSaneLock wrapper for pidlocks

This commit is contained in:
Joey Hess 2015-11-16 15:35:41 -04:00
parent e2b4861bff
commit 262c37c16e
Failed to extract signature
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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