[kaffe] CVS kaffe (guilhem): Fixes for VMSelector.

Kaffe CVS cvs-commits at kaffe.org
Tue Mar 29 10:05:18 PST 2005


PatchSet 5621 
Date: 2005/03/29 17:58:50
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixes for VMSelector.

        * libraries/clib/nio/gnu_java_nio_VMSelector.c
        (helper_select): Use KSELECT instead of select.
        (select): Use GetStaticMethodID as the method is static.

Members: 
	ChangeLog:1.3792->1.3793 
	libraries/clib/nio/gnu_java_nio_VMSelector.c:1.3->1.4 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3792 kaffe/ChangeLog:1.3793
--- kaffe/ChangeLog:1.3792	Mon Mar 28 19:32:50 2005
+++ kaffe/ChangeLog	Tue Mar 29 17:58:50 2005
@@ -1,3 +1,9 @@
+2005-03-29  Guilhem Lavaux  <guilhem at kaffe.org>
+
+	* libraries/clib/nio/gnu_java_nio_VMSelector.c
+	(helper_select): Use KSELECT instead of select.
+	(select): Use GetStaticMethodID as the method is static.
+
 2005-03-28  Guilhem Lavaux  <guilhem at kaffe.org>
 
 	* kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
Index: kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c
diff -u kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c:1.3 kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c:1.4
--- kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c:1.3	Sat Mar 26 10:56:11 2005
+++ kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c	Tue Mar 29 17:58:55 2005
@@ -36,6 +36,7 @@
 exception statement from your version. */
 
 #include "config.h"
+#include "jsyscall.h"
 
 /* <sys/types.h> needs to be included on OSX before <sys/select.h> */
 #if defined(HAVE_SYS_TYPES_H)
@@ -154,11 +155,13 @@
 
 	while (1)
 	{
-		r = select (n, readfds, writefds, exceptfds,
-		      timeout ? &delay : NULL);
+		int retcode;
+
+		r = KSELECT (n, readfds, writefds, exceptfds,
+		      timeout ? &delay : NULL, &retcode);
 		      
-		if (r != -1 || errno != EINTR)
-			return r;
+		if (r != EINTR)
+			return retcode;
 
 		/* Here we know we got EINTR. */
 		if ( (*env)->CallStaticBooleanMethod(env, thread_class, thread_interrupted) )
@@ -209,7 +212,7 @@
 	jclass thread_class = (*env)->FindClass(env, "java/lang/Thread");
 	jmethodID thread_current_thread = (*env)->GetStaticMethodID(env, thread_class, "currentThread", "()Ljava/lang/Thread;");
 	jmethodID thread_interrupt = (*env)->GetMethodID(env, thread_class, "interrupt", "()V");
-	jmethodID thread_interrupted = (*env)->GetMethodID(env, thread_class, "interrupted", "()Z");
+	jmethodID thread_interrupted = (*env)->GetStaticMethodID(env, thread_class, "interrupted", "()Z");
 	jobject current_thread;
 	int max_fd = 0;
 	fd_set read_fds;




More information about the kaffe mailing list