From owner-freebsd-java Fri Oct 12 2:22: 3 2001 Delivered-To: freebsd-java@freebsd.org Received: from azrael.xs4all.nl (azrael.xs4all.nl [213.84.220.111]) by hub.freebsd.org (Postfix) with ESMTP id DFFA437B401 for ; Fri, 12 Oct 2001 02:21:59 -0700 (PDT) Received: (from remco@localhost) by azrael.xs4all.nl (8.11.6/8.11.6) id f9C9Lub08705 for freebsd-java@FreeBSD.ORG; Fri, 12 Oct 2001 11:21:57 +0200 (CEST) (envelope-from remco) Date: Fri, 12 Oct 2001 11:21:56 +0200 From: "Remco van 't Veer" To: FreeBSD Java List Subject: jdk1.3.1p4_1: Process.waitFor() always returns 0 Message-ID: <20011012112156.R71770@azrael.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-Spook: FMS ISACA ISEP WORM K3 MD5 Toffler Archives SURSAT NABS Atlas Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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