Fix Windows build with Win32 2.13.4+
authorJoey Hess <joeyh@joeyh.name>
Mon, 3 Jun 2024 17:04:15 +0000 (13:04 -0400)
committerJoey Hess <joeyh@joeyh.name>
Mon, 3 Jun 2024 17:04:15 +0000 (13:04 -0400)
Thanks, Oleg Tolmatcev

CHANGELOG
Utility/LockFile/Windows.hs

index d4a758df6a51763947c8efa543f91c50b8815dbd..693f55a8abf12e0bfc6e5d8cbacd8530e5ffcea7 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -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
index 2ab521e438c525afe50a5f698732149cc2a7a6f6..c8e7c1bf5242bed8f1d404263f490dde7b9a0efa 100644 (file)
@@ -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