Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jan 1998 22:47:01 -0700
From:      Nate Williams <nate@mt.sri.com>
To:        Craig Spannring <cts@cdsnet.net>
Cc:        freebsd-java@FreeBSD.ORG
Subject:   Re: Bug in java.lang.Process.waitFor()?
Message-ID:  <199801310547.WAA19669@mt.sri.com>
In-Reply-To: <199801310308.TAA24210@bangkok.office.cdsnet.net>
References:  <199801310308.TAA24210@bangkok.office.cdsnet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
> 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



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