From f0763ce2931d18042a3862f24274cc5f3570a93c Mon Sep 17 00:00:00 2001 From: john30 Date: Sun, 8 Apr 2018 09:07:43 +0200 Subject: [PATCH] allow more than one fd to be set by ppoll for checking error --- src/lib/utils/tcpsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/utils/tcpsocket.cpp b/src/lib/utils/tcpsocket.cpp index ac78e737..3efe6321 100755 --- a/src/lib/utils/tcpsocket.cpp +++ b/src/lib/utils/tcpsocket.cpp @@ -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