allow more than one fd to be set by ppoll for checking error

This commit is contained in:
john30
2018-04-08 09:07:43 +02:00
parent a177d5c486
commit f0763ce293
+1 -1
View File
@@ -98,7 +98,7 @@ TCPSocket* TCPClient::connect(const string& server, const uint16_t& port, int ti
fds[0].fd = sfd;
fds[0].events = POLLIN|POLLOUT;
ret = ppoll(fds, nfds, &tdiff, NULL);
if (ret >= 1 && fds[0].revents & POLLERR) {
if (ret == 1 && fds[0].revents & POLLERR) {
ret = -1;
}
#else