fix build with unix-2.8.0

Changed the parameters to openFd. So needed to add a small wrapper
library to keep supporting older versions as well.
This commit is contained in:
Joey Hess 2023-08-01 18:41:27 -04:00
parent 4ef16f53ed
commit 68c9b08faf
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
12 changed files with 51 additions and 16 deletions

View file

@ -19,6 +19,7 @@ module Utility.DirWatcher.Kqueue (
import Common
import Utility.DirWatcher.Types
import Utility.OpenFd
import System.Posix.Types
import Foreign.C.Types
@ -110,7 +111,7 @@ scanRecursive topdir prune = M.fromList <$> walk [] [topdir]
Nothing -> walk c rest
Just info -> do
mfd <- catchMaybeIO $
Posix.openFd dir Posix.ReadOnly Nothing Posix.defaultFileFlags
openFdWithMode (toRawFilePath dir) Posix.ReadOnly Nothing Posix.defaultFileFlags
case mfd of
Nothing -> walk c rest
Just fd -> do