use openFd from unix >= 2.8

This commit is contained in:
Inari Listenmaa
2024-09-09 19:44:49 +02:00
parent b914a25de3
commit bbf12458c7
2 changed files with 3 additions and 3 deletions

View File

@@ -347,7 +347,7 @@ library
else
build-depends:
terminfo >=0.4.0 && < 0.5,
unix >= 2.7.2 && < 2.8
unix >= 2.8
if impl(ghc>=8.2)
ghc-options: -fhide-source-paths

View File

@@ -34,8 +34,8 @@ stderrToFile :: FilePath -> IO ()
stderrToFile file =
do let mode = ownerReadMode<>ownerWriteMode<>groupReadMode<>otherReadMode
(<>) = unionFileModes
flags = defaultFileFlags { append = True }
fileFd <- openFd file WriteOnly (Just mode) flags
flags = defaultFileFlags { append = True, creat = Just mode }
fileFd <- openFd file WriteOnly flags
dupTo fileFd stdError
return ()
#else