Commit 37b77e8a authored by rrt's avatar rrt

[project @ 2001-08-15 15:02:04 by rrt]

Cut'n'paste the latest version of rawSystem, not the horrible old
past-its-sell-by-date version I had in my smelly old tree.
parent 2d4edc48
-----------------------------------------------------------------------------
-- $Id: SysTools.lhs,v 1.51 2001/08/15 14:59:34 rrt Exp $
-- $Id: SysTools.lhs,v 1.52 2001/08/15 15:02:04 rrt Exp $
--
-- (c) The University of Glasgow 2001
--
......@@ -805,12 +805,12 @@ getProcessID = Posix.getProcessID
rawSystem :: String -> IO ExitCode
rawSystem "" = ioException (IOError Nothing InvalidArgument "rawSystem" "null command" Nothing)
rawSystem cmd =
withUnsafeCString cmd $ \s -> do
withCString cmd $ \s -> do
status <- throwErrnoIfMinus1 "rawSystem" (primRawSystem s)
case status of
0 -> return ExitSuccess
n -> return (ExitFailure n)
foreign import ccall "rawSystemCmd" unsafe primRawSystem :: UnsafeCString -> IO Int
foreign import ccall "rawSystemCmd" unsafe primRawSystem :: CString -> IO Int
\end{code}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment