remove temp file in failure case

This commit is contained in:
Joey Hess 2017-06-06 14:23:33 -04:00
parent ed639c140d
commit 19a6227e6e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -124,6 +124,7 @@ tryLock lockfile = trySideLock lockfile $ \sidelock -> do
hClose h
let failedlock st = do
dropLock $ LockHandle tmp st sidelock
nukeFile tmp
return Nothing
let tooklock st = return $ Just $ LockHandle lockfile' st sidelock
ifM (linkToLock sidelock tmp lockfile')