Check for bind() failing. Closes #12299
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -995,7 +995,12 @@ GSocketError GSocket::Connect(GSocketStream stream)
|
||||
// If a local address has been set, then we need to bind to it before calling connect
|
||||
if (m_local && m_local->m_addr)
|
||||
{
|
||||
bind(m_fd, m_local->m_addr, m_local->m_len);
|
||||
if (bind(m_fd, m_local->m_addr, m_local->m_len) < 0)
|
||||
{
|
||||
Close();
|
||||
m_error = GSOCK_IOERR;
|
||||
return GSOCK_IOERR;
|
||||
}
|
||||
}
|
||||
|
||||
/* Connect it to the peer address, with a timeout (see below) */
|
||||
|
Reference in New Issue
Block a user