From 4f7279ab3ef8e5ac64f2c8d45889196cf29d0d2a Mon Sep 17 00:00:00 2001 From: Bryce McKinlay Date: Mon, 24 Sep 2001 04:51:50 +0000 Subject: 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 --- libjava/java/lang/PosixProcess.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'libjava/java/lang/PosixProcess.java') diff --git a/libjava/java/lang/PosixProcess.java b/libjava/java/lang/PosixProcess.java index 36182598b3b..459f76c3da7 100644 --- a/libjava/java/lang/PosixProcess.java +++ b/libjava/java/lang/PosixProcess.java @@ -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 () { -- cgit v1.2.3