From 14ce1badd4210ebb2660e0fb22ba4ff7f2986dee Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 13 Jan 2014 18:10:21 -0400 Subject: merge from git-annex --- Utility/Process.hs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'Utility/Process.hs') diff --git a/Utility/Process.hs b/Utility/Process.hs index 03cbe95..1945e4b 100644 --- a/Utility/Process.hs +++ b/Utility/Process.hs @@ -26,12 +26,12 @@ module Utility.Process ( withHandle, withBothHandles, withQuietOutput, - withNullHandle, createProcess, startInteractiveProcess, stdinHandle, stdoutHandle, stderrHandle, + devNull, ) where import qualified System.Process @@ -280,20 +280,18 @@ withQuietOutput :: CreateProcessRunner -> CreateProcess -> IO () -withQuietOutput creator p = withNullHandle $ \nullh -> do +withQuietOutput creator p = withFile devNull WriteMode $ \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 +devNull :: FilePath #ifndef mingw32_HOST_OS - devnull = "/dev/null" +devNull = "/dev/null" #else - devnull = "NUL" +devNull = "NUL" #endif {- Extract a desired handle from createProcess's tuple. -- cgit v1.2.3