summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-03-06 15:05:40 -0400
committerJoey Hess2016-03-06 15:05:40 -0400
commitd56333750e8cbea2a80962744602ba4243aeb8a7 (patch)
treef0dd43c8247c598cf349ff9155d5c8f93e2ba354
parent76d74c187f5441ed7115f0ab6024d1fcfc4f5050 (diff)
propellor spin
-rw-r--r--src/System/Console/Concurrent/Internal.hs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/System/Console/Concurrent/Internal.hs b/src/System/Console/Concurrent/Internal.hs
index a4cafb61..38cc867a 100644
--- a/src/System/Console/Concurrent/Internal.hs
+++ b/src/System/Console/Concurrent/Internal.hs
@@ -284,6 +284,7 @@ createProcessForeground p = do
fgProcess :: P.CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ConcurrentProcessHandle)
fgProcess p = do
+ print ("fgProcess", showProc p)
r@(_, _, _, h) <- P.createProcess p
`onException` dropOutputLock
-- Wait for the process to exit and drop the lock.
@@ -297,6 +298,7 @@ bgProcess :: P.CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, Co
bgProcess p = do
(toouth, fromouth) <- pipe
(toerrh, fromerrh) <- pipe
+ print ("bgProcess", showProc p)
let p' = p
{ P.std_out = rediroutput (P.std_out p) toouth
, P.std_err = rediroutput (P.std_err p) toerrh
@@ -318,6 +320,11 @@ bgProcess p = do
| otherwise = ss
#endif
+showProc = go . P.cmdspec
+ where
+ go (P.ShellCommand s) = s
+ go (P.RawCommand s ps) = show (s, ps)
+
willOutput :: P.StdStream -> Bool
willOutput P.Inherit = True
willOutput _ = False