harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r473463 - in /incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native: launcher/shared/main.c luni/shared/OSNetworkSystem.c
Date Fri, 10 Nov 2006 20:41:43 GMT
Author: geirm
Date: Fri Nov 10 12:41:42 2006
New Revision: 473463

URL: http://svn.apache.org/viewvc?view=rev&rev=473463
Log:
Fix a bug where a read_select would fail because of 
a signal.  Was detected in testcase that iterated through
connecting to a database :)

Tested on Ubuntu 6 - full classlib test using j9


Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
    incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c?view=diff&rev=473463&r1=473462&r2=473463
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
Fri Nov 10 12:41:42 2006
@@ -298,7 +298,10 @@
         /* HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY=Internal VM error: Out of memory\n
*/
         PORTLIB->nls_printf (PORTLIB, HYNLS_ERROR,
                             HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY);
+                            
+        goto bail;
     }
+    
     vmiPath[0] = '\0';
     strcpy (newPathToAdd, exeName);
     strcat (newPathToAdd, vmdllsubdir);

Modified: incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c?view=diff&rev=473463&r1=473462&r2=473463
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
(original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/luni/shared/OSNetworkSystem.c
Fri Nov 10 12:41:42 2006
@@ -808,7 +808,8 @@
   char message[MSGLEN];	
 
   I_32 result, flags = 0;
-
+  I_32 loopFlag = 1;
+  
   hysocketP = getJavaIoFileDescriptorContentsAsAPointer	(env, fileDescriptor);
   if (!hysock_socketIsValid (hysocketP))
     {
@@ -816,17 +817,23 @@
       return (jint) 0;
     }
 
-  result = hysock_select_read (hysocketP, 0, 1,	FALSE);	
+  do {
+      result = hysock_select_read (hysocketP, 0, 1,	FALSE);	
 
-  if (HYPORT_ERROR_SOCKET_TIMEOUT == result)
-    {
-      return (jint) 0;	  /* The read operation	timed out, so answer 0 bytes available */
-    }
-  else if (0 > result)
-    {
-      throwJavaNetSocketException (env,	result);
-      return (jint) 0;
-    }
+      if (HYPORT_ERROR_SOCKET_TIMEOUT == result)
+      {
+        return (jint) 0;	  /* The read operation	timed out, so answer 0 bytes available */
+      }
+      else if (HYPORT_ERROR_SOCKET_INTERRUPTED == result)  {
+          continue;
+      }
+      else if (0 > result)
+      {
+        throwJavaNetSocketException (env,	result);
+        return (jint) 0;
+      }
+    } while (HYPORT_ERROR_SOCKET_INTERRUPTED == result);
+        
   result = hysock_setflag (HYSOCK_MSG_PEEK, &flags);  /* Create	a 'peek' flag argument
for the read operation */
   if (0	> result)
     {



Mime
View raw message