-system cmd =
- withCString cmd $ \s -> do
- status <- throwErrnoIfMinus1 "system" (primSystem s)
- case status of
- 0 -> return ExitSuccess
- n -> return (ExitFailure n)
-
-foreign import ccall unsafe "systemCmd" primSystem :: CString -> IO Int
-
--- ---------------------------------------------------------------------------
--- rawSystem
-
--- rawSystem is in a separate file, so we can #include it various places.
-#include "RawSystem.hs-inc"
-
+system cmd = do
+ p <- runCommand cmd
+ waitForProcess p
+
+rawSystem :: String -> [String] -> IO ExitCode
+rawSystem cmd args = do
+ p <- runProcess cmd args Nothing Nothing Nothing Nothing Nothing
+ waitForProcess p