src/java.base/unix/native/libnio/ch/Net.c
branchniosocketimpl-branch
changeset 57274 07b6be5d9150
parent 57268 adcdd45830a0
child 57278 bf925a3ee68a
--- a/src/java.base/unix/native/libnio/ch/Net.c	Mon Mar 18 19:59:05 2019 +0000
+++ b/src/java.base/unix/native/libnio/ch/Net.c	Wed Mar 20 13:54:50 2019 +0000
@@ -804,7 +804,7 @@
     }
 }
 
-JNIEXPORT jint JNICALL
+JNIEXPORT jboolean JNICALL
 Java_sun_nio_ch_Net_pollConnect(JNIEnv *env, jobject this, jobject fdo, jlong timeout)
 {
     jint fd = fdval(env, fdo);
@@ -835,16 +835,12 @@
             return handleSocketError(env, ENOTCONN);
         }
         // connected
-        return 1;
-    } else if (result == 0) {
-        return 0;
+        return JNI_TRUE;
+    } else if (result == 0 || errno == EINTR) {
+        return JNI_FALSE;
     } else {
-        if (errno == EINTR) {
-            return IOS_INTERRUPTED;
-        } else {
-            JNU_ThrowIOExceptionWithLastError(env, "poll failed");
-            return IOS_THROWN;
-        }
+        JNU_ThrowIOExceptionWithLastError(env, "poll failed");
+        return JNI_FALSE;
     }
 }