This is the mail archive of the
java-prs@gcc.gnu.org
mailing list for the Java project.
[Bug libgcj/30937] Win32: Process.exitValue() does not work after multiple calls to a terminated process
- From: "r_ovidius at eml dot cc" <gcc-bugzilla at gcc dot gnu dot org>
- To: java-prs at gcc dot gnu dot org
- Date: 23 Feb 2007 20:53:18 -0000
- Subject: [Bug libgcj/30937] Win32: Process.exitValue() does not work after multiple calls to a terminated process
- References: <bug-30937-7936@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from r_ovidius at eml dot cc 2007-02-23 20:53 -------
Also seems to affect process.destroy() somehow. The "DONE" is not printed
after the destroy call on gcj win32, but is on Sun.
public class ProcTest {
static Process process;
public static void main(String[] args) {
try {
String bat = "exitcode.bat";
PrintStream p = new PrintStream(new FileOutputStream(bat));
p.println("@exit 5");
p.close();
process = Runtime.getRuntime().exec(bat);
try {
int wf = process.waitFor();
System.err.println(wf);
} catch (InterruptedException e) {
}
try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
} catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
}
try {
int ev = process.exitValue();
System.err.println("EV: " + ev + " " + process);
} catch (IllegalThreadStateException ile) {
System.err.println("X: " + ile);
}
process.destroy();
System.err.println("DONE");
} catch (Exception e) {
e.printStackTrace();
}
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30937