module Main (main) where
import Control.Concurrent (threadDelay)
import System.Process (createProcess, proc, getProcessExitCode, terminateProcess)
main :: IO ()
main = do
(_, _, _, ph) <- createProcess $ proc "/usr/bin/sleep" ["100"]
terminateProcess ph
threadDelay 1000000
print =<< getProcessExitCode ph
-- prints Just ExitSuccess, should be Just (ExitFailure 143)
term1: sleep 100
term2: pkill sleep
term1: echo $? # 143
Anyone know what might be going on?
--
Michael Xavier
http://www.michaelxavier.net