From 044d9244e5482fa263606eb29325287a9d01421c Mon Sep 17 00:00:00 2001 From: a5ob7r <12132068+a5ob7r@users.noreply.github.com> Date: Sat, 5 Nov 2022 00:11:06 +0900 Subject: [PATCH] Fix compatibilities with unix 2.8.0.0 The version of unix removes the 3rd Maybe FileMode argument of openFd, so we need to handle this breaking change using a MIN_VERSION macro. The argument is integrated with the OpenFileFlags argument and the integrated value in defaultFileFlags is Nothing, so there's no difference between the two function calls. --- src/XMonad/Core.hs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs index de4a9a7..982d555 100644 --- a/src/XMonad/Core.hs +++ b/src/XMonad/Core.hs @@ -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