diff src/solaris/native/java/net/SocketInputStream.c @ 6963:472f8d774ecd

8036584: Review comments from 8035897 Reviewed-by: alanb
author chegar
date Tue, 04 Mar 2014 13:27:55 +0000
parents 7f4951e1b985
children
line wrap: on
line diff
--- a/src/solaris/native/java/net/SocketInputStream.c	Tue Mar 11 18:37:40 2014 +0000
+++ b/src/solaris/native/java/net/SocketInputStream.c	Tue Mar 04 13:27:55 2014 +0000
@@ -100,16 +100,16 @@
     }
 
     if (timeout) {
-        nread = NET_Timeout(env, fd, timeout);
+        nread = NET_Timeout(fd, timeout);
         if (nread <= 0) {
-            if ((*env)->ExceptionCheck(env)) {
-                // fall-through, to potentially free, then return
-            } else if (nread == 0) {
+            if (nread == 0) {
                 JNU_ThrowByName(env, JNU_JAVANETPKG "SocketTimeoutException",
                             "Read timed out");
             } else if (nread == JVM_IO_ERR) {
                 if (errno == EBADF) {
                      JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Socket closed");
+                 } else if (errno == ENOMEM) {
+                     JNU_ThrowOutOfMemoryError(env, "NET_Timeout native heap allocation failed");
                  } else {
                      NET_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
                                                   "select/poll failed");