[commit: process] master: Tidy up some CPP (8e699cb)
Ian Lynagh
igloo at earth.li
Sat Apr 27 22:53:08 CEST 2013
Repository : ssh://darcs.haskell.org//srv/darcs/packages/process
On branch : master
http://hackage.haskell.org/trac/ghc/changeset/8e699cb87155d9aa351b1cd0e79ae00e4a9d9e1d
>---------------------------------------------------------------
commit 8e699cb87155d9aa351b1cd0e79ae00e4a9d9e1d
Author: Ian Lynagh <ian at well-typed.com>
Date: Sat Apr 27 21:00:21 2013 +0100
Tidy up some CPP
>---------------------------------------------------------------
System/Process.hs | 17 ++++-------------
1 files changed, 4 insertions(+), 13 deletions(-)
diff --git a/System/Process.hs b/System/Process.hs
index 8399ad4..e3aa98d 100644
--- a/System/Process.hs
+++ b/System/Process.hs
@@ -573,13 +573,11 @@ rawSystem cmd args = syncProcess "rawSystem" (proc cmd args)
#elif !mingw32_HOST_OS
-- crude fallback implementation: could do much better than this under Unix
rawSystem cmd args = system (showCommandForUser cmd args)
-#else /* mingw32_HOST_OS && ! __GLASGOW_HASKELL__ */
-# if __HUGS__
+#elif __HUGS__
rawSystem cmd args = system (cmd ++ showCommandForUser "" args)
-# else
+#else
rawSystem cmd args = system (showCommandForUser cmd args)
#endif
-#endif
-- | Given a program @p@ and arguments @args@,
-- @showCommandForUser p args@ returns a string suitable for pasting
@@ -631,20 +629,14 @@ interruptProcessGroupOf
:: ProcessHandle -- ^ A process in the process group
-> IO ()
interruptProcessGroupOf ph = do
-#if mingw32_HOST_OS
withProcessHandle ph $ \p_ -> do
case p_ of
ClosedHandle _ -> return ()
OpenHandle h -> do
+#if mingw32_HOST_OS
pid <- getProcessId h
generateConsoleCtrlEvent cTRL_BREAK_EVENT pid
- return ()
-#else
- withProcessHandle ph $ \p_ -> do
- case p_ of
- ClosedHandle _ -> return ()
- OpenHandle h -> do
-#if MIN_VERSION_unix(2,5,0)
+#elif MIN_VERSION_unix(2,5,0)
-- getProcessGroupIDOf was added in unix-2.5.0.0
pgid <- getProcessGroupIDOf h
signalProcessGroup sigINT pgid
@@ -652,7 +644,6 @@ interruptProcessGroupOf ph = do
signalProcessGroup sigINT h
#endif
return ()
-#endif
-- ----------------------------------------------------------------------------
-- getProcessExitCode
More information about the ghc-commits
mailing list