Merge pull request #428 from a5ob7r/compatible_with_unix_2.8.0

Fix compatibilities with unix 2.8.0.0
This commit is contained in:
Tony Zorman 2022-11-05 08:13:37 +01:00 committed by GitHub
commit cf4d6f31b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE ExistentialQuantification #-}
{-# LANGUAGE FlexibleInstances #-}
@ -452,7 +453,11 @@ xfork x = io . forkProcess . finally nullStdin $ do
x
where
nullStdin = do
#if MIN_VERSION_unix(2,8,0)
fd <- openFd "/dev/null" ReadOnly defaultFileFlags
#else
fd <- openFd "/dev/null" ReadOnly Nothing defaultFileFlags
#endif
dupTo fd stdInput
closeFd fd