8201474: (so) Socket adaptor connect(InetAddress, timeout) succeeds when connection fails

Reviewed-by: bpb
This commit is contained in:
Alan Bateman 2018-04-14 08:41:42 +01:00
parent 85fbf32898
commit 45fb75c85a
5 changed files with 46 additions and 16 deletions

View file

@ -431,8 +431,8 @@ class ServerSocketChannelImpl
boolean polled = false;
try {
begin(true);
int n = Net.poll(fd, Net.POLLIN, timeout);
polled = (n > 0);
int events = Net.poll(fd, Net.POLLIN, timeout);
polled = (events != 0);
} finally {
end(true, polled);
}