PosixProcess.java (exitValue): Implement here.

* java/lang/PosixProcess.java (exitValue): Implement here. Throw
	IllegalThreadStateException if process hasn't exited yet.
	* java/lang/natPosixProcess.cc (exitValue): Removed.
	(waitFor): Only check thread interrupted status if waitpid()
	returned an error. Use WIFEXITED and WEXITSTATUS to process process's
	exit value.

From-SVN: r45766
This commit is contained in:
Bryce McKinlay 2001-09-24 04:51:50 +00:00 committed by Bryce McKinlay
parent 749ced524c
commit 4f7279ab3e
3 changed files with 28 additions and 28 deletions

View file

@ -26,7 +26,13 @@ import java.io.IOException;
final class ConcreteProcess extends Process
{
public native void destroy ();
public native int exitValue ();
public int exitValue ()
{
if (! hasExited)
throw new IllegalThreadStateException("Process has not exited");
return status;
}
public InputStream getErrorStream ()
{