This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] SelectorImpl.java (fix bootstrap)


I've committed the following as obvious to fix a native bootstrap failure.
(Well, maybe not obvious but I think it's close to what was intended, and
the code probably wasn't really usable prior anywow.)

Michael, I think you left this file out of your last patch.  Also I didn't
see an attachment on your email.

Jeff

2003-09-25  Jeff Sturm  <jsturm@one-point.com>

	Fix build failure.
	* gnu/java/nio/SelectorImpl.java (getFDsAsArray): Use getNativeFD().
	(select): Likewise.
	(register): Use DatagramChannelSelectionKey, SocketChannelSelectionKey.

Index: gnu/java/nio/SelectorImpl.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/nio/SelectorImpl.java,v
retrieving revision 1.8
diff -u -p -r1.8 SelectorImpl.java
--- gnu/java/nio/SelectorImpl.java	25 Sep 2003 17:09:23 -0000	1.8
+++ gnu/java/nio/SelectorImpl.java	26 Sep 2003 03:20:30 -0000
@@ -125,7 +125,7 @@ public class SelectorImpl extends Abstra

         if ((key.interestOps () & ops) != 0)
           {
-            result[counter] = key.fd;
+            result[counter] = key.getNativeFD();
             counter++;
           }
       }
@@ -172,7 +172,7 @@ public class SelectorImpl extends Abstra
         // Set new ready read/accept ops
         for (int i = 0; i < read.length; i++)
           {
-            if (key.fd == read[i])
+            if (key.getNativeFD() == read[i])
               {
                 if (key.channel () instanceof ServerSocketChannelImpl)
                   {
@@ -188,7 +188,7 @@ public class SelectorImpl extends Abstra
         // Set new ready write ops
         for (int i = 0; i < write.length; i++)
           {
-            if (key.fd == write[i])
+            if (key.getNativeFD() == write[i])
               {
                 ops = ops | SelectionKey.OP_WRITE;

@@ -253,17 +253,17 @@ public class SelectorImpl extends Abstra
     if (ch instanceof SocketChannelImpl)
       {
         SocketChannelImpl sc = (SocketChannelImpl) ch;
-        result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
+        result = new SocketChannelSelectionKey (ch, this); // FIXME: last argument
       }
     else if (ch instanceof DatagramChannelImpl)
       {
         DatagramChannelImpl dc = (DatagramChannelImpl) ch;
-        result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
+        result = new DatagramChannelSelectionKey (ch, this); // FIXME: last argument
       }
     else if (ch instanceof ServerSocketChannelImpl)
       {
         ServerSocketChannelImpl ssc = (ServerSocketChannelImpl) ch;
-        result = new SelectionKeyImpl (ch, this, 0); // FIXME: last argument
+        result = new SocketChannelSelectionKey (ch, this); // FIXME: last argument
       }
     else
       {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]