aboutsummaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 23:35:24 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 23:35:24 -0400
commit3237ddb564f5d2c07d03184d4f43c9c33c612a6c (patch)
tree7fef6e09b3cbcb6ea48d04b56cac070dd46df3c6 /Logs
parent8907359a875c2deb76d9386e398d97e4e4103fe2 (diff)
fix crash in stale transfer lockfile cleanup code
Need to differentiate between the lockfile not being locked, and it not existing.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Transfer.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Logs/Transfer.hs b/Logs/Transfer.hs
index ef1db879c..471b886b3 100644
--- a/Logs/Transfer.hs
+++ b/Logs/Transfer.hs
@@ -140,9 +140,10 @@ checkTransfer t = do
let lck = transferLockFile tfile
v <- getLockStatus lck
case v of
- Just pid -> catchDefaultIO Nothing $
+ StatusLockedBy pid -> catchDefaultIO Nothing $
readTransferInfoFile (Just pid) tfile
- Nothing -> do
+ StatusNoLockFile -> return Nothing
+ StatusUnLocked -> do
-- Take a non-blocking lock while deleting
-- the stale lock file.
r <- tryLockExclusive Nothing lck