This commit is contained in:
Joey Hess 2012-04-21 23:32:33 -04:00
parent bee420bd2d
commit ed79596b75
27 changed files with 56 additions and 52 deletions

View file

@ -18,7 +18,7 @@ import Annex.Perms
lockFile :: FilePath -> Annex ()
lockFile file = go =<< fromPool file
where
go (Just _) = return () -- already locked
go (Just _) = noop -- already locked
go Nothing = do
mode <- annexFileMode
fd <- liftIO $ noUmask mode $
@ -27,10 +27,9 @@ lockFile file = go =<< fromPool file
changePool $ M.insert file fd
unlockFile :: FilePath -> Annex ()
unlockFile file = go =<< fromPool file
unlockFile file = maybe noop go =<< fromPool file
where
go Nothing = return ()
go (Just fd) = do
go fd = do
liftIO $ closeFd fd
changePool $ M.delete file