summaryrefslogtreecommitdiff
path: root/libjava/java/lang/PosixProcess.java
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-24 04:51:50 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-24 04:51:50 +0000
commitc45e1891954393477056fdc0e52887903f22a737 (patch)
tree33c2555a1c6fe8aeecedad3f79917cb12aaf94e5 /libjava/java/lang/PosixProcess.java
parent5124a2c8eabf7035b98321a52a51a4998c207062 (diff)
downloadgcc-c45e1891954393477056fdc0e52887903f22a737.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45766 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/PosixProcess.java')
-rw-r--r--libjava/java/lang/PosixProcess.java8
1 files changed, 7 insertions, 1 deletions
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 ()
{