[kaffe] CVS kaffe (guilhem): Fixlets + VMSelector merged back.

Rei Odaira ray at is.s.u-tokyo.ac.jp
Mon Apr 11 07:22:30 PDT 2005


Hi,

> +  while (1)
> +    {
> +      r = select (n, readfds, writefds, exceptfds, timeout ? &delay : NULL);
> +
> +      if (r < 0 && errno != EINTR)
> +	return -errno;
> +      else if (r >= 0)
> +	return r;

Could anyone replace this select() with KSELECT()?

Thanks in advance,
Rei
-------------- next part --------------
Index: libraries/clib/nio/gnu_java_nio_VMSelector.c
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/clib/nio/gnu_java_nio_VMSelector.c,v
retrieving revision 1.10
diff -a -u -r1.10 gnu_java_nio_VMSelector.c
--- libraries/clib/nio/gnu_java_nio_VMSelector.c	10 Apr 2005 16:46:12 -0000	1.10
+++ libraries/clib/nio/gnu_java_nio_VMSelector.c	11 Apr 2005 14:25:24 -0000
@@ -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)
@@ -151,12 +152,15 @@
 
   while (1)
     {
-      r = select (n, readfds, writefds, exceptfds, timeout ? &delay : NULL);
+      int retcode;
 
-      if (r < 0 && errno != EINTR)
-	return -errno;
-      else if (r >= 0)
-	return r;
+      r = KSELECT (n, readfds, writefds, exceptfds,
+		   timeout ? &delay : NULL, &retcode);
+
+      if (r == 0)
+	return retcode;
+      if (r != EINTR)
+	return -r;
 
       /* Here we know we got EINTR. */
       if ((*env)->


More information about the kaffe mailing list