summaryrefslogtreecommitdiff
path: root/Annex/LockPool/PosixOrPid.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Annex/LockPool/PosixOrPid.hs')
-rw-r--r--Annex/LockPool/PosixOrPid.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Annex/LockPool/PosixOrPid.hs b/Annex/LockPool/PosixOrPid.hs
index c788f6fa0..47d2e5144 100644
--- a/Annex/LockPool/PosixOrPid.hs
+++ b/Annex/LockPool/PosixOrPid.hs
@@ -49,12 +49,10 @@ tryLockExclusive m f = tryPidLock m f $ Posix.tryLockExclusive m f
checkLocked :: LockFile -> Annex (Maybe Bool)
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
+ checkpid pidlock = Pid.checkLocked pidlock >>= \case
+ -- 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