Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Oct 2001 11:21:56 +0200
From:      "Remco van 't Veer" <rwvtveer@xs4all.nl>
To:        FreeBSD Java List <freebsd-java@FreeBSD.ORG>
Subject:   jdk1.3.1p4_1: Process.waitFor() always returns 0
Message-ID:  <20011012112156.R71770@azrael.xs4all.nl>

next in thread | raw e-mail | index | archive | help
Hi,

The exit status for a Process is not passed properly.  The native
1.3.1p4 jdk always returns 0 on a Process.waitFor().  Please try
to following class:

  import java.io.*;

  public class Z
  {
      public static void main (String[] args)
      throws Exception
      {
          String[] pargs = { "false" };
          Process proc = null;
          try
          {
              proc = Runtime.getRuntime().exec(pargs);
          }
          catch (IOException ex) { }
          
          System.out.println("exit status: "+proc.waitFor());
      }
  }

Please look at the following output:

  $ java -version
  java version "1.2.2"
  Classic VM (build jdk1.2.2-FreeBSD:root:2001/05/19-03:26, green threads, nojit)
  $ java Z
  exit status: 256
  $ java -version
  java version "1.3.1-internal"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-internal-remco-010917-23:11)
  Classic VM (build 1.3.1-internal-remco-010917-23:11, green threads, nojit)
  $ java Z
  exit status: 0
  $ java -version
  java version "1.2.2"
  Classic VM (build Linux_JDK_1.2.2_RC4, green threads, sunwjit)
  $ java Z
  exit status: 1
  $ java -version # linux version
  java version "1.3.1_01"
  Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
  Classic VM (build 1.3.1_01, green threads, nojit)
  $ java Z
  exit status: 1

I am using FreeBSD 4.4 release.

Remco


-- 
We are committed to engage in energetically reinventing progressive
synergies.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011012112156.R71770>