/* Do not use a static struct, Linux can garble it */
tv.tv_sec = m_timeout / 1000;
- tv.tv_usec = (m_timeout % 1000) / 1000;
+ tv.tv_usec = (m_timeout % 1000) * 1000;
FD_ZERO(&readfds);
FD_ZERO(&writefds);
m_establishing = false;
- getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*)&error, (SOCKLEN_T*) &len);
+ getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void*)&error, &len);
if (error)
{