From owner-freebsd-java Fri Jan 30 21:47:51 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA19732 for java-outgoing; Fri, 30 Jan 1998 21:47:51 -0800 (PST) (envelope-from owner-freebsd-java@FreeBSD.ORG) Received: from ns.mt.sri.com (sri-gw.MT.net [206.127.105.141]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA19727 for ; Fri, 30 Jan 1998 21:47:50 -0800 (PST) (envelope-from nate@mt.sri.com) Received: from mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.8.8/8.8.8) with SMTP id WAA24582; Fri, 30 Jan 1998 22:47:04 -0700 (MST) (envelope-from nate@rocky.mt.sri.com) Received: by mt.sri.com (SMI-8.6/SMI-SVR4) id WAA19669; Fri, 30 Jan 1998 22:47:01 -0700 Date: Fri, 30 Jan 1998 22:47:01 -0700 Message-Id: <199801310547.WAA19669@mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Craig Spannring Cc: freebsd-java@FreeBSD.ORG Subject: Re: Bug in java.lang.Process.waitFor()? In-Reply-To: <199801310308.TAA24210@bangkok.office.cdsnet.net> References: <199801310308.TAA24210@bangkok.office.cdsnet.net> X-Mailer: VM 6.29 under 19.15 XEmacs Lucid Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org X-To-Unsubscribe: mail to majordomo@FreeBSD.org "unsubscribe java" > I can't seem to get the waitFor() to ever return. The problem appears > in both jdk1.1.5 port and the jdk1.1.2 for FreeBSD. The waitFor() in > the Windows jdk1.1.4 seems to work fine the way I'm using it. ... > import java.lang.Runtime; > import java.lang.Process; > > > public class WaitProblem > { > public static void main(String argv[]) > throws java.io.IOException, java.lang.InterruptedException > { > String cmd[] = {"grep", "foo", "afile"}; > Runtime rt = Runtime.getRuntime(); > Process p; > > System.out.println("Executing the command"); > p = rt.exec(cmd); > System.out.println("Command should be running"); > p.waitFor(); > // never gets here > System.out.println("Command should be done"); > } > } Hmm, you're right, this is indeed a bug. Thanks for reporting it! Nate