diff options
Diffstat (limited to 'Utility')
-rw-r--r-- | Utility/Process.hs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Utility/Process.hs b/Utility/Process.hs index 3a8677fa3..590124289 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -25,6 +25,7 @@ module Utility.Process ( withHandle, withBothHandles, withQuietOutput, + withNullHandle, createProcess, startInteractiveProcess, stdinHandle, @@ -241,12 +242,15 @@ withQuietOutput :: CreateProcessRunner -> CreateProcess -> IO () -withQuietOutput creator p = withFile devnull WriteMode $ \nullh -> do +withQuietOutput creator p = withNullHandle $ \nullh -> do let p' = p { std_out = UseHandle nullh , std_err = UseHandle nullh } creator p' $ const $ return () + +withNullHandle :: (Handle -> IO a) -> IO a +withNullHandle = withFile devnull WriteMode where #ifndef mingw32_HOST_OS devnull = "/dev/null" |