fix build on windows

This commit is contained in:
Joey Hess 2021-12-09 13:39:16 -04:00
parent 5f1f6d0cec
commit 61b48b69ba
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
2 changed files with 7 additions and 5 deletions

View file

@ -22,7 +22,7 @@ import Utility.LockPool.STM (LockFile, LockMode(..))
{- Tries to lock a file with a shared lock, which allows other processes to
- also lock it shared. Fails if the file is exclusively locked. -}
lockShared :: LockFile -> IO (Maybe LockHandle)
lockShared file = tryMakeLockHandle P.lockPool file
lockShared file = fmap fst <$> tryMakeLockHandle P.lockPool file
(\p f -> P.tryTakeLock p f LockShared)
(\f _ -> fmap mk <$> F.lockShared f)
@ -33,7 +33,7 @@ lockShared file = tryMakeLockHandle P.lockPool file
- read or write by any other process. So for advisory locking of a file's
- content, a separate LockFile should be used. -}
lockExclusive :: LockFile -> IO (Maybe LockHandle)
lockExclusive file = tryMakeLockHandle P.lockPool file
lockExclusive file = fmap fst <$> tryMakeLockHandle P.lockPool file
(\p f -> P.tryTakeLock p f LockExclusive)
(\f _ -> fmap mk <$> F.lockExclusive f)
@ -42,7 +42,7 @@ lockExclusive file = tryMakeLockHandle P.lockPool file
waitToLock :: IO (Maybe lockhandle) -> IO lockhandle
waitToLock = F.waitToLock
mk :: F.LockHandle -> FileLockOps
mk h = FileLockOps
mk :: F.LockHandle -> (FileLockOps, ())
mk h = (FileLockOps
{ fDropLock = F.dropLock h
}
}, ())

View file

@ -72,3 +72,5 @@ Utility\LockPool\Windows.hs:38:18: error:
[[!meta author=jwodder]]
[[!tag projects/datalad]]
> [[fixed|done]] --[[Joey]]