From: simonmar Date: Wed, 21 Sep 2005 11:54:59 +0000 (+0000) Subject: [project @ 2005-09-21 11:54:59 by simonmar] X-Git-Tag: cmm-merge2~24 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=e51e0f3addd2a30e1e4c52119eb1c64cbdeff455;p=ghc-base.git [project @ 2005-09-21 11:54:59 by simonmar] improve documentation for getProcessExitCode --- diff --git a/System/Process.hs b/System/Process.hs index f30967a..fa10b4c 100644 --- a/System/Process.hs +++ b/System/Process.hs @@ -228,7 +228,7 @@ fdToHandle pfd mode = do {- | Waits for the specified process to terminate, and returns its exit code. - GHC Note: in order to call waitForProcess without blocking all the + GHC Note: in order to call @waitForProcess@ without blocking all the other threads in the system, you must compile the program with @-threaded@. -} @@ -259,8 +259,12 @@ terminateProcess (ProcessHandle pid) = -- ---------------------------------------------------------------------------- -- getProcessExitCode -{- | Verifies whether the process is completed and if it is then returns the exit code. - If the process is still running the function returns Nothing +{- | +This is a non-blocking version of 'waitForProcess'. If the process is +still running, 'Nothing' is returned. If the process has exited, then +@'Just' e@ is returned where @e@ is the exit code of the process. +Subsequent calls to @getProcessExitStatus@ always return @'Just' +'ExitSuccess'@, regardless of what the original exit code was. -} getProcessExitCode :: ProcessHandle -> IO (Maybe ExitCode) getProcessExitCode (ProcessHandle handle) =