public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: select: don't set ready for exception on socket shutdown
Date: Tue,  6 Apr 2021 19:35:58 +0000 (GMT)	[thread overview]
Message-ID: <20210406193558.AB2323857819@sourceware.org> (raw)

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

commit caa78917b68a9f5cff65b22e0e53ebd53b2dc5c7
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue Apr 6 21:26:33 2021 +0200

    Cygwin: select: don't set ready for exception on socket shutdown
    
    So far select wrongly sets the descriptor as ready for exception
    when a shutdown occurs.  This is entirely non-standard.  Only set
    this bit on an out-of-band event.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/select.cc | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/winsup/cygwin/select.cc b/winsup/cygwin/select.cc
index 6e8586d17..956cd9bc1 100644
--- a/winsup/cygwin/select.cc
+++ b/winsup/cygwin/select.cc
@@ -1920,10 +1920,7 @@ fhandler_socket_wsock::select_write (select_stuff *ss)
   s->write_ready = saw_shutdown_write () || connect_state () == unconnected;
   s->write_selected = true;
   if (connect_state () != unconnected)
-    {
-      s->except_ready = saw_shutdown_write () || saw_shutdown_read ();
-      s->except_on_write = true;
-    }
+    s->except_on_write = true;
   return s;
 }
 
@@ -1938,8 +1935,6 @@ fhandler_socket_wsock::select_except (select_stuff *ss)
       s->cleanup = socket_cleanup;
     }
   s->peek = peek_socket;
-  /* FIXME: Is this right?  Should these be used as criteria for except? */
-  s->except_ready = saw_shutdown_write () || saw_shutdown_read ();
   s->except_selected = true;
   return s;
 }


                 reply	other threads:[~2021-04-06 19:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210406193558.AB2323857819@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).