Is it safe to call getProcessExitCode more than once?

David Brown haskell at davidb.org
Thu Oct 28 01:13:23 EDT 2004


On Thu, Oct 28, 2004 at 06:27:42AM +0200, Peter Simons wrote:
> Glynn Clements writes:
> 
>  > Both [waitForProcess and getProcessExitCode] will throw
>  > an exception if the process terminated on a signal.
> 
> So if I terminate a process manually, I'll have to wait for
> the ExitCode to avoid a zombie process, and waiting for the
> ExitCode invariably throws an exception.

It's just the way that Unix process management works.  I guess you have to
catch the exception to handle it well.  This is part of the aspect that
makes writing shells so complicated.

Dave


More information about the Glasgow-haskell-users mailing list