diff -r fd40b0b3d849 -r ffbb784a8873 src/java.base/unix/native/libnio/ch/SocketChannelImpl.c --- a/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c Tue Feb 06 23:49:10 2018 +0530 +++ b/src/java.base/unix/native/libnio/ch/SocketChannelImpl.c Tue Feb 06 16:04:46 2018 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,8 +47,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_SocketChannelImpl_checkConnect(JNIEnv *env, jobject this, - jobject fdo, jboolean block, - jboolean ready) + jobject fdo, jboolean block) { int error = 0; socklen_t n = sizeof(int); @@ -56,19 +55,16 @@ int result = 0; struct pollfd poller; - poller.revents = 1; - if (!ready) { - poller.fd = fd; - poller.events = POLLOUT; - poller.revents = 0; - result = poll(&poller, 1, block ? -1 : 0); - if (result < 0) { - JNU_ThrowIOExceptionWithLastError(env, "Poll failed"); - return IOS_THROWN; - } - if (!block && (result == 0)) - return IOS_UNAVAILABLE; + poller.fd = fd; + poller.events = POLLOUT; + poller.revents = 0; + result = poll(&poller, 1, block ? -1 : 0); + if (result < 0) { + JNU_ThrowIOExceptionWithLastError(env, "Poll failed"); + return IOS_THROWN; } + if (!block && (result == 0)) + return IOS_UNAVAILABLE; if (poller.revents) { errno = 0;