Patch: close I/O channels when a process ends

Andrew Haley aph@redhat.com
Thu Aug 5 21:25:00 GMT 2004


David Daney writes:
 > Tom Tromey wrote:
 > >>>>>>"Andrew" == Andrew Haley <aph@redhat.com> writes:
 > > 
 > > 
 > > Andrew> I ran out of file handles.  Was there any reason we weren't
 > > Andrew> closing the files in Process.waitFor?
 > > 
 > > It probably isn't valid to do this.
 > > Couldn't there still be data in the OS' pipe buffer?
 > > 
 > > Tom
 > 
 > My patch that is waiting for approval is an almost total rewrite of
 > natPosixProcess, so would replace this.  However it would not solve the
 > problem either.
 > 
 > I think that the place to fix this is in
 > FileInputStream/FileChannelImpl.  When you get end-of-file when reading
 > a pipe/file, you should close the descriptor there.

But we can still close the output channels here, can we?

Andrew.



More information about the Java-patches mailing list