summaryrefslogtreecommitdiff
path: root/Remote/Helper/Hooks.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Helper/Hooks.hs')
-rw-r--r--Remote/Helper/Hooks.hs10
1 files changed, 2 insertions, 8 deletions
diff --git a/Remote/Helper/Hooks.hs b/Remote/Helper/Hooks.hs
index 96f73cce3..529c35d3f 100644
--- a/Remote/Helper/Hooks.hs
+++ b/Remote/Helper/Hooks.hs
@@ -83,18 +83,12 @@ runHooks r starthook stophook a = do
unlockFile lck
#ifndef mingw32_HOST_OS
mode <- annexFileMode
- fd <- liftIO $ noUmask mode $ createLockFile (Just mode) lck
- v <- liftIO $ tryIO $
- setLock fd (WriteLock, AbsoluteSeek, 0, 0)
- case v of
- Left _ -> noop
- Right _ -> run stophook
- liftIO $ closeFd fd
+ v <- liftIO $ noUmask mode $ tryLockExclusive (Just mode) lck
#else
v <- liftIO $ lockExclusive lck
+#endif
case v of
Nothing -> noop
Just lockhandle -> do
run stophook
liftIO $ dropLock lockhandle
-#endif