From 6c69780d13d8b8419853b4a9fa738ebe19c3449d Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Wed, 23 Jun 2021 23:59:54 -0400 Subject: [PATCH 1/2] cbits/posix: Fix const-correctness in non-posix_spawnp path Previously this would throw a warning when posix_spawnp isn't available. --- cbits/posix/posix_spawn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cbits/posix/posix_spawn.c b/cbits/posix/posix_spawn.c index 17d20435..9683081e 100644 --- a/cbits/posix/posix_spawn.c +++ b/cbits/posix/posix_spawn.c @@ -8,7 +8,7 @@ #if !defined(HAVE_POSIX_SPAWNP) ProcHandle do_spawn_posix (char *const args[], - const char *workingDirectory, const char **environment, + char *workingDirectory, char **environment, struct std_handle *stdInHdl, struct std_handle *stdOutHdl, struct std_handle *stdErrHdl, @@ -208,4 +208,4 @@ do_spawn_posix (char *const args[], return ret; } -#endif \ No newline at end of file +#endif From fc05e9f4808ed78db6d191ecd654fa6b72ff3126 Mon Sep 17 00:00:00 2001 From: Ben Gamari Date: Mon, 12 Jul 2021 17:06:09 +0000 Subject: [PATCH 2/2] test: Use isWindows instead of `System.Info.os` --- test/main.hs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/main.hs b/test/main.hs index 3dba7e02..4f886222 100644 --- a/test/main.hs +++ b/test/main.hs @@ -13,12 +13,11 @@ import System.IO (hClose, openBinaryTempFile, hGetContents) import qualified Data.ByteString as S import qualified Data.ByteString.Char8 as S8 import System.Directory (getTemporaryDirectory, removeFile) -import System.Info (os) ifWindows :: IO () -> IO () ifWindows action - | os /= "windows" = return () - | otherwise = action + | not isWindows = return () + | otherwise = action isWindows :: Bool #if WINDOWS