If connect() fails with EINPROGRESS, the connection may be completed
by polling/selecting the socket for writing. This commit replaces
POLLIN with POLLOUT to handle it properly.
Change-Id: If332634c6d517d7ec00f19a5970e7fe16ee9bb06
int retval = TEMP_FAILURE_RETRY(connect(m_sock, (struct sockaddr*)&clientAddr, SUN_LEN(&clientAddr)));
if ((retval == -1) && (errno == EINPROGRESS)) {
- if (0 >= waitForSocket(m_sock, POLLIN, POLL_TIMEOUT)) {
+ if (0 >= waitForSocket(m_sock, POLLOUT, POLL_TIMEOUT)) {
LogError("Error in waitForSocket.");
return SECURITY_MANAGER_ERROR_SOCKET;
}