mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
choose openFd based on version of unix
This commit is contained in:
@@ -34,8 +34,13 @@ stderrToFile :: FilePath -> IO ()
|
||||
stderrToFile file =
|
||||
do let mode = ownerReadMode<>ownerWriteMode<>groupReadMode<>otherReadMode
|
||||
(<>) = unionFileModes
|
||||
#if MIN_VERSION_unix(2,8,0)
|
||||
flags = defaultFileFlags { append = True, creat = Just mode }
|
||||
fileFd <- openFd file WriteOnly flags
|
||||
#else
|
||||
flags = defaultFileFlags { append = True }
|
||||
fileFd <- openFd file WriteOnly (Just mode) flags
|
||||
#endif
|
||||
dupTo fileFd stdError
|
||||
return ()
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user