harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r747301 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main: java/org/apache/harmony/luni/platform/OSNetworkSystem.java native/luni/unix/OSNetworkSystemLinux.c
Date Tue, 24 Feb 2009 08:27:09 GMT
Author: hindessm
Date: Tue Feb 24 08:27:09 2009
New Revision: 747301

URL: http://svn.apache.org/viewvc?rev=747301&view=rev
Log:
Quick fix for NIO exception issue reported by Niklas Gustavsson
on 2009-02-22.  See:

  http://markmail.org/message/dccqpwxryi4ir245


Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java?rev=747301&r1=747300&r2=747301&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/java/org/apache/harmony/luni/platform/OSNetworkSystem.java
Tue Feb 24 08:27:09 2009
@@ -32,6 +32,7 @@
 final class OSNetworkSystem implements INetworkSystem {
 
     private static final int ERRORCODE_SOCKET_TIMEOUT = -209;
+    private static final int ERRORCODE_SOCKET_INTERRUPTED = -208;
 
     private static final int INETADDR_REACHABLE = 0;
 
@@ -365,7 +366,8 @@
         if (0 <= result) {
             return flags;
         }
-        if (ERRORCODE_SOCKET_TIMEOUT == result) {
+        if (ERRORCODE_SOCKET_TIMEOUT == result ||
+            ERRORCODE_SOCKET_INTERRUPTED == result) {
             return new int[0];
         }
         throw new SocketException();

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c?rev=747301&r1=747300&r2=747301&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/unix/OSNetworkSystemLinux.c
Tue Feb 24 08:27:09 2009
@@ -318,7 +318,20 @@
           }
       }
           (*env)->ReleaseIntArrayElements(env, outFlags, flagArray, changed ? 0 : JNI_ABORT);
+  } else if (result == 0) {
+
+    result = HYPORT_ERROR_SOCKET_TIMEOUT;
+
+  } else {
+
+    if (errno == EINTR) {
+      result = HYPORT_ERROR_SOCKET_INTERRUPTED;
+    } else {
+      result = HYPORT_ERROR_SOCKET_OPFAILED;
+    }
+
   }
+      
   hymem_free_memory(my_pollfds);
   
   /* return both correct and error result, let java code handle	exceptions */



Mime
View raw message