diff options
author | Peter Åstrand <astrand@cendio.se> | 2005-02-21 10:17:21 +0000 |
---|---|---|
committer | Peter Åstrand <astrand@cendio.se> | 2005-02-21 10:17:21 +0000 |
commit | 2ca93459482823da1a5884de23892134ed2d108d (patch) | |
tree | 8619bd72cd4c0630dd7ce27eb1d5e1ab64adc611 | |
parent | f82c5d3522cc870af7fbda2aa413d1fa60f9c914 (diff) | |
download | tigervnc-2ca93459482823da1a5884de23892134ed2d108d.tar.gz tigervnc-2ca93459482823da1a5884de23892134ed2d108d.zip |
Make TcpSocket build on Win32 again.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@205 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | network/TcpSocket.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/network/TcpSocket.cxx b/network/TcpSocket.cxx index 3fe4a651..1d0de9f2 100644 --- a/network/TcpSocket.cxx +++ b/network/TcpSocket.cxx @@ -69,7 +69,7 @@ int network::findFreeTcpPort (void) for (port = TUNNEL_PORT_OFFSET + 99; port > TUNNEL_PORT_OFFSET; port--) { addr.sin_port = htons ((unsigned short) port); if (bind (sock, (struct sockaddr *)&addr, sizeof (addr)) == 0) { - close (sock); + closesocket (sock); return port; } } @@ -137,8 +137,10 @@ TcpSocket::TcpSocket(const char *host, int port) for (;;) { if (connect(sock, (struct sockaddr *)&addr, sizeof(addr)) != 0) { int e = errorNumber; +#ifndef WIN32 if (e == EINTR) continue; +#endif closesocket(sock); throw SocketException("unable to connect to host", e); } else break; |