sock: report the same events as linux when connect() fails

This commit is contained in:
Bert Belder 2018-11-16 23:42:16 -08:00
parent 43f8095c14
commit d6144b2e83
No known key found for this signature in database
GPG Key ID: 7A77887B2E2ED461

View File

@ -192,7 +192,9 @@ static inline uint32_t sock__afd_events_to_epoll_events(DWORD afd_events) {
if (afd_events & AFD_POLL_ABORT)
epoll_events |= EPOLLHUP;
if (afd_events & AFD_POLL_CONNECT_FAIL)
epoll_events |= EPOLLERR;
/* Linux reports all these events after connect() has failed. */
epoll_events |=
EPOLLIN | EPOLLOUT | EPOLLERR | EPOLLRDNORM | EPOLLWRNORM | EPOLLRDHUP;
return epoll_events;
}