Re: Is it safe to call getProcessExitCode more than once?

2004-10-30 Thread Peter Simons
Glynn Clements writes: Although, depending upon the OS, setting SIGCHLD to SIG_IGN may cause processes to be reaped automatically (i.e. not become zombies), so that's a possible alternative. I think I've got it under control now. I'm using this wrapper to make sure there are no

Re: Is it safe to call getProcessExitCode more than once?

2004-10-28 Thread Glynn Clements
David Brown wrote: 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

Re: Is it safe to call getProcessExitCode more than once?

2004-10-27 Thread David Brown
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

Re: Is it safe to call getProcessExitCode more than once?

2004-10-27 Thread Glynn Clements
Peter Simons wrote: 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

Re: Is it safe to call getProcessExitCode more than once?

2004-10-26 Thread Peter Simons
John Goerzen writes: Assuming it is based on wait() or one of its derivatives, and I suspect it is, you cannot call it more than once for a single process. That's what I _assume_, too, but a definite answer would be nice. In the meanwhile, I have found out that it might not be safe to

Re: Is it safe to call getProcessExitCode more than once?

2004-10-26 Thread Glynn Clements
Peter Simons wrote: John Goerzen writes: Assuming it is based on wait() or one of its derivatives, and I suspect it is, you cannot call it more than once for a single process. That's what I _assume_, too, but a definite answer would be nice. In the meanwhile, I have found out

Is it safe to call getProcessExitCode more than once?

2004-10-25 Thread Peter Simons
What will happen if I call getProcessExitCode for the same process twice? Will that block? Cause an error? Or return the same child's exit code again? I assume the function is (under Unix) based on wait(2), right? In that case, how does the following warning from the manual page translate to

Re: Is it safe to call getProcessExitCode more than once?

2004-10-25 Thread John Goerzen
On 2004-10-26, Peter Simons [EMAIL PROTECTED] wrote: What will happen if I call getProcessExitCode for the same process twice? Will that block? Cause an error? Or return the same child's exit code again? Assuming it is based on wait() or one of its derivatives, and I suspect it is, you cannot