* fhandler_socket.cc (fhandler_socket::evaluate_events): Handle
connect_state and af_local_connect connect call here, once, independent of FD_CONNECT being requested. Add comment to explain why. (fhandler_socket::connect): Drop connect_state handling and calling af_local_connect. Move remaining AF_LOCAL stuff prior to calling ::connect and explain why. Simplify error case. * poll.cc (poll): Handle connect state independently of POLLOUT being requested for the descriptor to allow setting POLLIN if connect failed. Add comment. * select.cc (set_bits): Drop connect_state and AF_LOCAL handling here.
This commit is contained in:
@@ -115,8 +115,9 @@ poll (struct pollfd *fds, nfds_t nfds, int timeout)
|
||||
So it looks like there's actually no good reason to
|
||||
return POLLERR. */
|
||||
fds[i].revents |= POLLIN;
|
||||
/* Handle failed connect. */
|
||||
if (FD_ISSET(fds[i].fd, write_fds)
|
||||
/* Handle failed connect. A failed connect implicitly sets
|
||||
POLLOUT, if requested, but it doesn't set POLLIN. */
|
||||
if ((fds[i].events & POLLIN)
|
||||
&& (sock = cygheap->fdtab[fds[i].fd]->is_socket ())
|
||||
&& sock->connect_state () == connect_failed)
|
||||
fds[i].revents |= (POLLIN | POLLERR);
|
||||
|
Reference in New Issue
Block a user