aboutsummaryrefslogtreecommitdiff
path: root/Annex/LockPool.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-12-13 00:24:19 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-12-13 00:24:19 -0400
commit94554782894ec6c26da3b46312d5d1d16d596458 (patch)
tree78746106bfb153945ccbfd2bbae536081c005e91 /Annex/LockPool.hs
parent55bd61d8c42aaf36a3c57f8444c493f6b045f4cd (diff)
finished where indentation changes
Diffstat (limited to 'Annex/LockPool.hs')
-rw-r--r--Annex/LockPool.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/Annex/LockPool.hs b/Annex/LockPool.hs
index b99a8ec4d..45fc55b3c 100644
--- a/Annex/LockPool.hs
+++ b/Annex/LockPool.hs
@@ -17,21 +17,21 @@ import Annex.Perms
{- Create a specified lock file, and takes a shared lock. -}
lockFile :: FilePath -> Annex ()
lockFile file = go =<< fromPool file
- where
- go (Just _) = noop -- already locked
- go Nothing = do
- mode <- annexFileMode
- fd <- liftIO $ noUmask mode $
- openFd file ReadOnly (Just mode) defaultFileFlags
- liftIO $ waitToSetLock fd (ReadLock, AbsoluteSeek, 0, 0)
- changePool $ M.insert file fd
+ where
+ go (Just _) = noop -- already locked
+ go Nothing = do
+ mode <- annexFileMode
+ fd <- liftIO $ noUmask mode $
+ openFd file ReadOnly (Just mode) defaultFileFlags
+ liftIO $ waitToSetLock fd (ReadLock, AbsoluteSeek, 0, 0)
+ changePool $ M.insert file fd
unlockFile :: FilePath -> Annex ()
unlockFile file = maybe noop go =<< fromPool file
- where
- go fd = do
- liftIO $ closeFd fd
- changePool $ M.delete file
+ where
+ go fd = do
+ liftIO $ closeFd fd
+ changePool $ M.delete file
getPool :: Annex (M.Map FilePath Fd)
getPool = getState lockpool