summaryrefslogtreecommitdiff
path: root/Utility/LockFile
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 14:10:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-05-19 14:12:23 -0400
commit2e819796cdfdfccb2ebef7b10e2653e58d832d83 (patch)
treef14a44cba9c85a04858c073a73586faad1740ef8 /Utility/LockFile
parentae5433c4caf0ee57e3338df6dcd625f20ece7101 (diff)
convert lockContent to use new LockPools
Also cleaned up the code, avoiding creating a lock file if we're going to open it for create later anyway. And, if there's an exception while preparing to lock the file, but not at the point of actually taking the lock, throw an exception, instead of silently not locking and pretending to succeed. And, on Windows, always use lock file, even if the repo somehow got into indirect mode (maybe with cygwin git..)
Diffstat (limited to 'Utility/LockFile')
-rw-r--r--Utility/LockFile/Posix.hs11
1 files changed, 0 insertions, 11 deletions
diff --git a/Utility/LockFile/Posix.hs b/Utility/LockFile/Posix.hs
index 12275c48a..65ba328df 100644
--- a/Utility/LockFile/Posix.hs
+++ b/Utility/LockFile/Posix.hs
@@ -10,8 +10,6 @@ module Utility.LockFile.Posix (
lockShared,
lockExclusive,
tryLockExclusive,
- createLockFile,
- openExistingLockFile,
checkLocked,
getLockStatus,
dropLock,
@@ -56,15 +54,6 @@ lock lockreq mode lockfile = do
waitToSetLock l (lockreq, AbsoluteSeek, 0, 0)
return (LockHandle l)
--- Create and opens lock file; does not lock it.
-createLockFile :: FileMode -> LockFile -> IO Fd
-createLockFile filemode = openLockFile (Just filemode)
-
--- Opens an existing lock file; does not lock it, and if it does not exist,
--- returns Nothing.
-openExistingLockFile :: LockFile -> IO (Maybe Fd)
-openExistingLockFile = catchMaybeIO . openLockFile Nothing
-
-- Close on exec flag is set so child processes do not inherit the lock.
openLockFile :: Maybe FileMode -> LockFile -> IO Fd
openLockFile filemode lockfile = do