From e51e0f3addd2a30e1e4c52119eb1c64cbdeff455 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 21 Sep 2005 11:54:59 +0000 Subject: [PATCH] [project @ 2005-09-21 11:54:59 by simonmar] improve documentation for getProcessExitCode --- System/Process.hs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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) = -- 1.7.10.4