From 881ad9e4055473e2c7f6100833e8dfeb804b621b Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sun, 29 Feb 2004 11:14:20 -0800 Subject: natPosixProcess.cc (startProcess): Implement standard streams using FileChannelImpl, not FileDescriptor. * java/lang/natPosixProcess.cc (startProcess): Implement standard streams using FileChannelImpl, not FileDescriptor. * java/lang/natWin32Process.cc (startProcess): Likewise. From-SVN: r78664 --- libjava/java/lang/natPosixProcess.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libjava/java/lang/natPosixProcess.cc') diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc index a6dfc1a..644c0a1 100644 --- a/libjava/java/lang/natPosixProcess.cc +++ b/libjava/java/lang/natPosixProcess.cc @@ -32,11 +32,14 @@ details. */ #include #include #include +#include #include #include #include #include +using gnu::java::nio::channels::FileChannelImpl; + extern char **environ; void @@ -187,9 +190,9 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray, // We create the streams before forking. Otherwise if we had an // error while creating the streams we would have run the child // with no way to communicate with it. - errorStream = new FileInputStream (new FileDescriptor (errp[0])); - inputStream = new FileInputStream (new FileDescriptor (inp[0])); - outputStream = new FileOutputStream (new FileDescriptor (outp[1])); + errorStream = new FileInputStream (new FileChannelImpl(errp[0], FileChannelImpl::READ)); + inputStream = new FileInputStream (new FileChannelImpl(inp[0], FileChannelImpl::READ)); + outputStream = new FileOutputStream (new FileChannelImpl(outp[0], FileChannelImpl::WRITE)); // We don't use vfork() because that would cause the local // environment to be set by the child. -- cgit v1.1