Fix Windows build with Win32 2.13.4+
Thanks, Oleg Tolmatcev
This commit is contained in:
parent
176eb9c9c6
commit
da2c02162c
2 changed files with 13 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
git-annex (10.20240532) UNRELEASED; urgency=medium
|
||||
|
||||
* Fix Windows build with Win32 2.13.4+
|
||||
Thanks, Oleg Tolmatcev
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Mon, 03 Jun 2024 13:03:21 -0400
|
||||
|
||||
git-annex (10.20240531) upstream; urgency=medium
|
||||
|
||||
* git-remote-annex: New program which allows pushing a git repo to a
|
||||
|
|
|
@ -21,6 +21,9 @@ import Control.Concurrent
|
|||
|
||||
import Utility.Path.Windows
|
||||
import Utility.FileSystemEncoding
|
||||
#if MIN_VERSION_Win32(2,13,4)
|
||||
import Common (tryNonAsync)
|
||||
#endif
|
||||
|
||||
type LockFile = RawFilePath
|
||||
|
||||
|
@ -59,9 +62,9 @@ openLock :: ShareMode -> LockFile -> IO (Maybe LockHandle)
|
|||
openLock sharemode f = do
|
||||
f' <- convertToWindowsNativeNamespace f
|
||||
#if MIN_VERSION_Win32(2,13,4)
|
||||
r <- tryNonAsync $ createFile_NoRetry f' gENERIC_READ sharemode
|
||||
security_attributes oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
|
||||
(maybePtr Nothing)
|
||||
r <- tryNonAsync $ createFile_NoRetry (fromRawFilePath f') gENERIC_READ sharemode
|
||||
Nothing oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
|
||||
Nothing
|
||||
return $ case r of
|
||||
Left _ -> Nothing
|
||||
Right h -> Just h
|
||||
|
|
Loading…
Add table
Reference in a new issue