From 436e47584ae7aecf0ec22a98384a3348d244471f Mon Sep 17 00:00:00 2001 From: Ken Brown Date: Wed, 7 Apr 2021 11:43:27 -0400 Subject: [PATCH] Cygwin: select: set_bits: fix return value If a socket descriptor is set to ready for reading on a failed connect, increment the return value. --- winsup/cygwin/select.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc index b493ccc11..8ad982c12 100644 --- a/winsup/cygwin/select.cc +++ b/winsup/cygwin/select.cc @@ -527,7 +527,10 @@ set_bits (select_record *me, fd_set *readfds, fd_set *writefds, /* Set readfds entry in case of a failed connect. */ if (!me->read_ready && me->read_selected && sock->connect_state () == connect_failed) - UNIX_FD_SET (me->fd, readfds); + { + UNIX_FD_SET (me->fd, readfds); + ready++; + } } ready++; } -- 2.43.5