summaryrefslogtreecommitdiff
path: root/Utility/SafeCommand.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-07-18 13:30:53 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-07-18 13:31:00 -0400
commit05310538ef4f2c0c483bab355083ec2044a12a0a (patch)
treec16d81764f760d82a3060e6a6f81f33cee87fae6 /Utility/SafeCommand.hs
parent182526ff68b1ca68952b4dbd32121e46d4a80e85 (diff)
more debugging
Diffstat (limited to 'Utility/SafeCommand.hs')
-rw-r--r--Utility/SafeCommand.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Utility/SafeCommand.hs b/Utility/SafeCommand.hs
index 2c6439b45..5f6a53e71 100644
--- a/Utility/SafeCommand.hs
+++ b/Utility/SafeCommand.hs
@@ -54,6 +54,7 @@ safeSystem command params = safeSystemEnv command params Nothing
{- SIGINT(ctrl-c) is allowed to propigate and will terminate the program. -}
safeSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO ExitCode
safeSystemEnv command params env = do
+ putStrLn "safeSystemEnv start"
-- Going low-level because all the high-level system functions
-- block SIGINT etc. We need to block SIGCHLD, but allow
-- SIGINT to do its default program termination.
@@ -65,7 +66,9 @@ safeSystemEnv command params env = do
mps <- getProcessStatus True False childpid
restoresignals oldint oldset
case mps of
- Just (Exited code) -> return code
+ Just (Exited code) -> do
+ putStrLn "safeSystemEnv end"
+ return code
_ -> error $ "unknown error running " ++ command
where
restoresignals oldint oldset = do
@@ -78,9 +81,11 @@ safeSystemEnv command params env = do
{- executeFile with debug logging -}
executeFile :: FilePath -> Bool -> [String] -> Maybe [(String, String)] -> IO ()
executeFile c path p e = do
+ putStrLn "executeFile start"
--debugM "Utility.SafeCommand.executeFile" $
-- "Running: " ++ c ++ " " ++ show p ++ " " ++ maybe "" show e
System.Posix.Process.executeFile c path p e
+ putStrLn "executeFile end"
{- Escapes a filename or other parameter to be safely able to be exposed to
- the shell. -}