More FreeBSD build fixes.

Untested, on FreeBSD but enough to fix the listed build errors.

Seems that System.Posix.Files must have used to export this stuff and it
was split.

This commit was sponsored by Peter on Patreon.
This commit is contained in:
Joey Hess 2018-09-24 11:25:51 -04:00
parent dfcaf2389b
commit cc82f81227
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 18 additions and 7 deletions

View file

@ -11,6 +11,7 @@ git-annex (6.20180914) UNRELEASED; urgency=medium
as the rest of git's interface is used in newline-safe ways.
* Added -z option to git-annex commands that use --batch, useful for
supporting filenames containing newlines.
* More FreeBSD build fixes.
[ Yaroslav Halchenko ]
* debian/control

View file

@ -27,7 +27,8 @@ import Foreign.Ptr
import Foreign.Marshal
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import qualified System.Posix.Files as Files
import qualified System.Posix.Files as Posix
import qualified System.Posix.IO as Posix
import Control.Concurrent
data Change
@ -109,7 +110,7 @@ scanRecursive topdir prune = M.fromList <$> walk [] [topdir]
Nothing -> walk c rest
Just info -> do
mfd <- catchMaybeIO $
Files.openFd dir Files.ReadOnly Nothing Files.defaultFileFlags
Posix.openFd dir Posix.ReadOnly Nothing Posix.defaultFileFlags
case mfd of
Nothing -> walk c rest
Just fd -> do
@ -129,7 +130,7 @@ addSubDirs dirmap prune dirs = do
{- Removes a subdirectory (and all its children) from a directory map. -}
removeSubDir :: DirMap -> FilePath -> IO DirMap
removeSubDir dirmap dir = do
mapM_ Files.closeFd $ M.keys toremove
mapM_ Posix.closeFd $ M.keys toremove
return rest
where
(toremove, rest) = M.partition (dirContains dir . dirName) dirmap
@ -167,7 +168,7 @@ updateKqueue (Kqueue h _ dirmap _) =
{- Stops a Kqueue. Note: Does not directly close the Fds in the dirmap,
- so it can be reused. -}
stopKqueue :: Kqueue -> IO ()
stopKqueue = Files.closeFd . kqueueFd
stopKqueue = Posix.closeFd . kqueueFd
{- Waits for a change on a Kqueue.
- May update the Kqueue.
@ -249,9 +250,9 @@ runHooks kq hooks = do
withstatus change $ dispatchadd dirmap
dispatchadd dirmap change s
| Files.isSymbolicLink s = callhook addSymlinkHook (Just s) change
| Files.isDirectory s = recursiveadd dirmap change
| Files.isRegularFile s = callhook addHook (Just s) change
| Posix.isSymbolicLink s = callhook addSymlinkHook (Just s) change
| Posix.isDirectory s = recursiveadd dirmap change
| Posix.isRegularFile s = callhook addHook (Just s) change
| otherwise = noop
recursiveadd dirmap change = do

View file

@ -51,3 +51,5 @@ Compilation failure is as follows:
/usr/home/duncan/code/git-annex/.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0/setup/setup --builddir=.stack-work/dist/x86_64-freebsd/Cabal-1.24.2.0 build exe:git
-annex --ghc-options " -ddump-hi -ddump-to-file"
Process exited with code: ExitFailure 1
> [[done]] --[[Joey]]

View file

@ -0,0 +1,7 @@
[[!comment format=mdwn
username="joey"
subject="""comment 1"""
date="2018-09-24T15:24:30Z"
content="""
Seems it also needs to import System.Posix.IO, which I've now committed.
"""]]