fix lockFileShared to actually create lock file

This was a bug, but it was only used for ssh locks and by the hook special
remote locking. At least in the case of ssh locks, the lock files happened
to already exist before this tried to use them, so the bug didn't cause
anything to break.
This commit is contained in:
Joey Hess 2014-08-20 15:49:49 -04:00
parent bf3133ebb0
commit 0a4d301051

View file

@ -36,7 +36,7 @@ lockFileShared file = go =<< fromLockPool file
#ifndef mingw32_HOST_OS
mode <- annexFileMode
lockhandle <- liftIO $ noUmask mode $
openFd file ReadOnly (Just mode) defaultFileFlags
openFd file ReadWrite (Just mode) defaultFileFlags
liftIO $ setFdOption lockhandle CloseOnExec True
liftIO $ waitToSetLock lockhandle (ReadLock, AbsoluteSeek, 0, 0)
#else