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-annex (10.20240531) upstream; urgency=medium
|
||||||
|
|
||||||
* git-remote-annex: New program which allows pushing a git repo to a
|
* 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.Path.Windows
|
||||||
import Utility.FileSystemEncoding
|
import Utility.FileSystemEncoding
|
||||||
|
#if MIN_VERSION_Win32(2,13,4)
|
||||||
|
import Common (tryNonAsync)
|
||||||
|
#endif
|
||||||
|
|
||||||
type LockFile = RawFilePath
|
type LockFile = RawFilePath
|
||||||
|
|
||||||
|
@ -59,9 +62,9 @@ openLock :: ShareMode -> LockFile -> IO (Maybe LockHandle)
|
||||||
openLock sharemode f = do
|
openLock sharemode f = do
|
||||||
f' <- convertToWindowsNativeNamespace f
|
f' <- convertToWindowsNativeNamespace f
|
||||||
#if MIN_VERSION_Win32(2,13,4)
|
#if MIN_VERSION_Win32(2,13,4)
|
||||||
r <- tryNonAsync $ createFile_NoRetry f' gENERIC_READ sharemode
|
r <- tryNonAsync $ createFile_NoRetry (fromRawFilePath f') gENERIC_READ sharemode
|
||||||
security_attributes oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
|
Nothing oPEN_ALWAYS fILE_ATTRIBUTE_NORMAL
|
||||||
(maybePtr Nothing)
|
Nothing
|
||||||
return $ case r of
|
return $ case r of
|
||||||
Left _ -> Nothing
|
Left _ -> Nothing
|
||||||
Right h -> Just h
|
Right h -> Just h
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue