diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2006-07-27 17:58:54 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2006-07-27 17:58:54 +0400 |
commit | fd5879c110763e58717a23b259ecabd01a88684b (patch) | |
tree | 06d1bbfc98d6e9ad63bb65a2def2fdb687f47b15 /winsup/cygwin/poll.cc | |
parent | 883861544a879eb161b1186ba6c62335a923aaca (diff) |
* fhandler_socket.cc: Revert misguided attempt to handle FD_CLOSE error
conditions in evaluate_events.
(search_wsa_event_slot): Move wrongly placed memset in
fhandler_socket::init_events here.
(fhandler_socket::init_events): Initially set FD_WRITE event for
connectionless sockets.
* poll.cc (poll): Don't add sockets always to except_fds since select
is now supposed to do it right.
* select.cc (set_bits): Set connection state correctly for failed
af_local_connect on local sockets. Remove socket special handling
for except_selected descriptors.
(peek_socket): Try to set the read/write/exception bits actually
correctly.
Diffstat (limited to 'winsup/cygwin/poll.cc')
-rw-r--r-- | winsup/cygwin/poll.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/winsup/cygwin/poll.cc b/winsup/cygwin/poll.cc index 3ce46fab6..a7db49ef8 100644 --- a/winsup/cygwin/poll.cc +++ b/winsup/cygwin/poll.cc @@ -1,6 +1,6 @@ /* poll.cc. Implements poll(2) via usage of select(2) call. - Copyright 2000, 2001, 2002, 2003, 2004, 2005 Red Hat, Inc. + Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006 Red Hat, Inc. This file is part of Cygwin. @@ -63,9 +63,7 @@ poll (struct pollfd *fds, unsigned int nfds, int timeout) FD_SET(fds[i].fd, read_fds); if (fds[i].events & POLLOUT) FD_SET(fds[i].fd, write_fds); - /* On sockets, except_fds is needed to catch failed connects. */ - if ((fds[i].events & POLLPRI) - || cygheap->fdtab[fds[i].fd]->is_socket ()) + if (fds[i].events & POLLPRI) FD_SET(fds[i].fd, except_fds); } else if (fds[i].fd >= 0) @@ -127,7 +125,6 @@ poll (struct pollfd *fds, unsigned int nfds, int timeout) } /* Handle failed connect. */ if (FD_ISSET(fds[i].fd, write_fds) - && FD_ISSET(fds[i].fd, except_fds) && (sock = cygheap->fdtab[fds[i].fd]->is_socket ()) && sock->connect_state () == connect_failed) fds[i].revents |= (POLLIN | POLLERR); |