1
0
forked from GitHub/gf-core

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 else
build-depends: build-depends:
terminfo >=0.4.0 && < 0.5, terminfo >=0.4.0 && < 0.5,
unix >= 2.7.2 && < 2.8 unix >= 2.8
if impl(ghc>=8.2) if impl(ghc>=8.2)
ghc-options: -fhide-source-paths ghc-options: -fhide-source-paths

View File

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