From 2799793789d5b66c90efbd1a3eb56e0c1ec57f88 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Thu, 5 Oct 2006 02:44:18 +0000 Subject: 2006-10-05 Andrew John Hughes * Merge of HEAD-->generics for 2006/09/03-2006/10/04. --- native/jni/java-lang/java_lang_VMProcess.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'native/jni/java-lang/java_lang_VMProcess.c') diff --git a/native/jni/java-lang/java_lang_VMProcess.c b/native/jni/java-lang/java_lang_VMProcess.c index e9d85fa65..a6076f2ae 100644 --- a/native/jni/java-lang/java_lang_VMProcess.c +++ b/native/jni/java-lang/java_lang_VMProcess.c @@ -38,7 +38,7 @@ exception statement from your version. */ #include #include "java_lang_VMProcess.h" -#include "gnu_java_nio_channels_FileChannelImpl.h" +#include "gnu_java_nio_FileChannelImpl.h" #include #include @@ -137,8 +137,8 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this, char *dir = NULL; pid_t pid = -1; char errbuf[64]; - jmethodID method; - jclass clazz; + jmethodID method, vmmethod; + jclass clazz, vmclazz; int i; int pipe_count = redirect ? 2 : 3; int err; @@ -214,10 +214,12 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this, } /* Create Input/OutputStream objects around parent file descriptors */ - clazz = (*env)->FindClass (env, "gnu/java/nio/channels/FileChannelImpl"); + vmclazz = (*env)->FindClass (env, "gnu/java/nio/VMChannel"); + clazz = (*env)->FindClass (env, "gnu/java/nio/FileChannelImpl"); if ((*env)->ExceptionOccurred (env)) goto done; - method = (*env)->GetMethodID (env, clazz, "", "(II)V"); + vmmethod = (*env)->GetMethodID (env, vmclazz, "", "(I)V"); + method = (*env)->GetMethodID (env, clazz, "", "(Lgnu/java/nio/VMChannel;I)V"); if ((*env)->ExceptionOccurred (env)) goto done; for (i = 0; i < pipe_count; i++) @@ -228,11 +230,16 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this, jclass sclazz; jmethodID smethod; - jobject channel = (*env)->NewObject (env, clazz, method, fd, mode); + jobject vmchannel; + jobject channel; + vmchannel = (*env)->NewObject (env, vmclazz, vmmethod, fd); + if ((*env)->ExceptionOccurred (env)) + goto done; + channel = (*env)->NewObject (env, clazz, method, vmchannel, mode); if ((*env)->ExceptionOccurred (env)) goto done; - if (mode == gnu_java_nio_channels_FileChannelImpl_WRITE) + if (mode == gnu_java_nio_FileChannelImpl_WRITE) sclazz = (*env)->FindClass (env, "java/io/FileOutputStream"); else sclazz = (*env)->FindClass (env, "java/io/FileInputStream"); @@ -240,7 +247,7 @@ Java_java_lang_VMProcess_nativeSpawn (JNIEnv * env, jobject this, goto done; smethod = (*env)->GetMethodID (env, sclazz, "", - "(Lgnu/java/nio/channels/FileChannelImpl;)V"); + "(Lgnu/java/nio/FileChannelImpl;)V"); if ((*env)->ExceptionOccurred (env)) goto done; -- cgit v1.2.1