summaryrefslogtreecommitdiffstats
path: root/libjava/java/lang/natPosixProcess.cc
diff options
context:
space:
mode:
authorbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-29 19:14:20 +0000
committerbothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-29 19:14:20 +0000
commitb49feda2e14797ea8770b92e2d75a75fff449308 (patch)
treea23a9ed058e8310fc0daddc0f10c9b2ecbcbdac1 /libjava/java/lang/natPosixProcess.cc
parentb2468e06703f481bfd0739d1b0f4392cf4653cd5 (diff)
downloadppe42-gcc-b49feda2e14797ea8770b92e2d75a75fff449308.tar.gz
ppe42-gcc-b49feda2e14797ea8770b92e2d75a75fff449308.zip
* java/lang/natPosixProcess.cc (startProcess): Implement standard
streams using FileChannelImpl, not FileDescriptor. * java/lang/natWin32Process.cc (startProcess): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@78664 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/natPosixProcess.cc')
-rw-r--r--libjava/java/lang/natPosixProcess.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc
index a6dfc1ada28..644c0a1ac46 100644
--- a/libjava/java/lang/natPosixProcess.cc
+++ b/libjava/java/lang/natPosixProcess.cc
@@ -32,11 +32,14 @@ details. */
#include <java/lang/Thread.h>
#include <java/io/File.h>
#include <java/io/FileDescriptor.h>
+#include <gnu/java/nio/channels/FileChannelImpl.h>
#include <java/io/FileInputStream.h>
#include <java/io/FileOutputStream.h>
#include <java/io/IOException.h>
#include <java/lang/OutOfMemoryError.h>
+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.
OpenPOWER on IntegriCloud