4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-08 18:19:08 +08:00

Cygwin: AF_UNIX: select_read: fix thinko

Don't set read_ready true if the socket is not connected.  One of the
uses of select is for a listening socket to wait for a connection
request.
This commit is contained in:
Ken Brown 2020-10-25 17:05:37 -04:00
parent b3cef213d8
commit fc26f2932b

View File

@ -2100,10 +2100,7 @@ fhandler_socket_unix::select_read (select_stuff *ss)
s->cleanup = socket_unix_cleanup;
s->read_selected = true;
grab_admin_pkt ();
/* FIXME: Is this right? The test for being connected isn't done
for wsock sockets. */
s->read_ready = (saw_shutdown () & _SHUT_RECV)
|| connect_state () != connected;
s->read_ready = (saw_shutdown () & _SHUT_RECV);
return s;
}