Fix error handling in connection_management

pull/2002/head
Brian Cloutier 2018-03-15 16:53:35 -07:00 committed by Brian Cloutier
parent 224b0a8c14
commit 98ffafe16e
1 changed files with 19 additions and 12 deletions

View File

@ -533,7 +533,13 @@ FinishConnectionEstablishment(MultiConnection *connection)
*/
break;
}
else if (pollResult != EINTR)
else
{
int errorCode = errno;
#ifdef WIN32
errorCode = WSAGetLastError();
#endif
if (errorCode == EINTR)
{
/* Retrying, signal interrupted. So check. */
CHECK_FOR_INTERRUPTS();
@ -546,7 +552,8 @@ FinishConnectionEstablishment(MultiConnection *connection)
* programming error somewhere, not a network etc. issue.
*/
ereport(ERROR, (errcode_for_socket_access(),
errmsg("poll() failed: %m")));
errmsg("poll()/select() failed: %m")));
}
}
}
}