public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: select: set_bits: fix return value
@ 2021-04-07 15:47 Ken Brown
  0 siblings, 0 replies; only message in thread
From: Ken Brown @ 2021-04-07 15:47 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=436e47584ae7aecf0ec22a98384a3348d244471f

commit 436e47584ae7aecf0ec22a98384a3348d244471f
Author: Ken Brown <kbrown@cornell.edu>
Date:   Wed Apr 7 11:43:27 2021 -0400

    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.

Diff:
---
 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++;
     }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-07 15:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-07 15:47 [newlib-cygwin] Cygwin: select: set_bits: fix return value Ken Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).