diff options
author | Alon Levy <alevy@redhat.com> | 2010-12-06 17:55:45 +0200 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2010-12-08 17:11:45 +0200 |
commit | 1943352d6093ae27f1f4e80d786f4114be6032ac (patch) | |
tree | dd5ca4695ef94cd63d3ca991017917218e1de9f5 /client/red_peer.cpp | |
parent | 06749bd66bb3e689bc96be1a3739747912ee0020 (diff) | |
download | spice-1943352d6093ae27f1f4e80d786f4114be6032ac.tar.gz spice-1943352d6093ae27f1f4e80d786f4114be6032ac.tar.xz spice-1943352d6093ae27f1f4e80d786f4114be6032ac.zip |
mingw32 build: fixed using -1 as uninitialized value for unsigned variables
Diffstat (limited to 'client/red_peer.cpp')
-rw-r--r-- | client/red_peer.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/client/red_peer.cpp b/client/red_peer.cpp index 08176d09..6ff58446 100644 --- a/client/red_peer.cpp +++ b/client/red_peer.cpp @@ -91,7 +91,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr) THROW_ERR(SPICEC_ERROR_CODE_GETHOSTBYNAME_FAILED, "cannot resolve host address %s", host); } Lock lock(_lock); - _peer = -1; + _peer = INVALID_SOCKET; for (e = result; e != NULL; e = e->ai_next) { if ((_peer = socket(e->ai_family, e->ai_socktype, e->ai_protocol)) == INVALID_SOCKET) { int err = sock_error(); @@ -112,7 +112,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr) LOG_INFO("Connect failed: %s (%d)", sock_err_message(err), err); closesocket(_peer); - _peer = -1; + _peer = INVALID_SOCKET; continue; } LOG_INFO("Connected to %s %s", uaddr, uport); @@ -120,7 +120,7 @@ void RedPeer::connect_unsecure(const char* host, int portnr) } lock.unlock(); freeaddrinfo(result); - if (_peer == -1) { + if (_peer == INVALID_SOCKET) { THROW_ERR(SPICEC_ERROR_CODE_CONNECT_FAILED, "failed to connect: %s (%d)", sock_err_message(err), err); } |