I've run into some strangeness with the process package. When you kill some processes on the command line you correctly get a non-zero exit status. However when using the process package's terminateProcess (which sends a SIGTERM), it returns an ExitSuccess:

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