public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "r_ovidius at eml dot cc" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcj/30937] Win32: Process.exitValue() does not work after multiple calls to a terminated process
Date: Fri, 23 Feb 2007 20:53:00 -0000	[thread overview]
Message-ID: <20070223205318.16120.qmail@sourceware.org> (raw)
In-Reply-To: <bug-30937-7936@http.gcc.gnu.org/bugzilla/>



------- 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


      reply	other threads:[~2007-02-23 20:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-23 19:37 [Bug libgcj/30937] New: " r_ovidius at eml dot cc
2007-02-23 20:53 ` r_ovidius at eml dot cc [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070223205318.16120.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).