|
|
@ -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 */ |
|
|
|