avoid build warning on windows
This commit is contained in:
parent
291ad8f6b2
commit
cb6cb61ca1
1 changed files with 16 additions and 11 deletions
|
@ -204,19 +204,24 @@ lockContentUsing contentlocker key fallback a = withContentLockFile key $ \mlock
|
||||||
alreadylocked = giveup "content is locked"
|
alreadylocked = giveup "content is locked"
|
||||||
failedtolock e = giveup $ "failed to lock content: " ++ show e
|
failedtolock e = giveup $ "failed to lock content: " ++ show e
|
||||||
|
|
||||||
lock locker mlockfile = tryIO $ locker >>= \case
|
|
||||||
Nothing -> alreadylocked
|
|
||||||
Just h ->
|
|
||||||
#ifndef mingw32_HOST_OS
|
#ifndef mingw32_HOST_OS
|
||||||
case mlockfile of
|
lock locker mlockfile =
|
||||||
Nothing -> return h
|
|
||||||
Just lockfile ->
|
|
||||||
ifM (checkSaneLock lockfile h)
|
|
||||||
( return h
|
|
||||||
, alreadylocked
|
|
||||||
)
|
|
||||||
#else
|
#else
|
||||||
return h
|
lock locker _mlockfile =
|
||||||
|
#endif
|
||||||
|
tryIO $ locker >>= \case
|
||||||
|
Nothing -> alreadylocked
|
||||||
|
Just h ->
|
||||||
|
#ifndef mingw32_HOST_OS
|
||||||
|
case mlockfile of
|
||||||
|
Nothing -> return h
|
||||||
|
Just lockfile ->
|
||||||
|
ifM (checkSaneLock lockfile h)
|
||||||
|
( return h
|
||||||
|
, alreadylocked
|
||||||
|
)
|
||||||
|
#else
|
||||||
|
return h
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
go (Right _) = a
|
go (Right _) = a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue