aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 15:35:41 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-11-16 15:35:41 -0400
commit7d5a6b9fea20a0aec0e716ea855b46e460b3da7d (patch)
tree65ee23d9672a6b8d4d3dc1de01a882095bc3ee1b
parent24cdd3abc3170f25913e49e8fb6ccf7b0d23a770 (diff)
add missing checkSaneLock wrapper for pidlocks
-rw-r--r--Annex/LockPool/PosixOrPid.hs7
-rw-r--r--Annex/Transfer.hs2
2 files changed, 7 insertions, 2 deletions
diff --git a/Annex/LockPool/PosixOrPid.hs b/Annex/LockPool/PosixOrPid.hs
index cc1411800..58e597f0e 100644
--- a/Annex/LockPool/PosixOrPid.hs
+++ b/Annex/LockPool/PosixOrPid.hs
@@ -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
diff --git a/Annex/Transfer.hs b/Annex/Transfer.hs
index 2b0c12c8a..fe428e21a 100644
--- a/Annex/Transfer.hs
+++ b/Annex/Transfer.hs
@@ -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