Browse Source

We are not interested in POLLIN in wait_close but any mode of a closed socket

master
Con Kolivas 10 years ago
parent
commit
6e7f39321d
  1. 4
      src/libckpool.c

4
src/libckpool.c

@ -893,13 +893,13 @@ int wait_close(int sockd, int timeout)
if (unlikely(sockd < 0)) if (unlikely(sockd < 0))
return -1; return -1;
sfd.fd = sockd; sfd.fd = sockd;
sfd.events = POLLIN; sfd.events = POLLRDHUP;
sfd.revents = 0; sfd.revents = 0;
timeout *= 1000; timeout *= 1000;
ret = poll(&sfd, 1, timeout); ret = poll(&sfd, 1, timeout);
if (ret < 1) if (ret < 1)
return 0; return 0;
return sfd.revents & POLLHUP; return sfd.revents & (POLLHUP | POLLRDHUP | POLLERR);
} }
/* Emulate a select read wait for high fds that select doesn't support */ /* Emulate a select read wait for high fds that select doesn't support */

Loading…
Cancel
Save