summaryrefslogtreecommitdiff
path: root/louloulibs/network
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2016-01-14 00:39:08 +0100
committerFlorent Le Coz <louiz@louiz.org>2016-01-13 16:39:08 +0100
commit0864f2ab99073b62e4173da694a13aa4ccc8b554 (patch)
tree9654149336476815c2e51e3259d7c41d0eecf0e5 /louloulibs/network
parented49e067a0d2fe25f4e3cd653258ad24a2772893 (diff)
downloadbiboumi-0864f2ab99073b62e4173da694a13aa4ccc8b554.tar.gz
biboumi-0864f2ab99073b62e4173da694a13aa4ccc8b554.tar.bz2
biboumi-0864f2ab99073b62e4173da694a13aa4ccc8b554.tar.xz
biboumi-0864f2ab99073b62e4173da694a13aa4ccc8b554.zip
Quiet a warning
Diffstat (limited to 'louloulibs/network')
-rw-r--r--louloulibs/network/tcp_socket_handler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/louloulibs/network/tcp_socket_handler.cpp b/louloulibs/network/tcp_socket_handler.cpp
index 6ed981c..81369dd 100644
--- a/louloulibs/network/tcp_socket_handler.cpp
+++ b/louloulibs/network/tcp_socket_handler.cpp
@@ -63,14 +63,14 @@ void TCPSocketHandler::init_socket(const struct addrinfo* rp)
// used in bind()
struct addrinfo* result;
int err = ::getaddrinfo(this->bind_addr.data(), nullptr, nullptr, &result);
- if (err != 0)
+ if (err != 0 || !result)
log_error("Failed to bind socket to " << this->bind_addr << ": "
<< gai_strerror(err));
else
{
utils::ScopeGuard sg([result](){ freeaddrinfo(result); });
struct addrinfo* rp;
- int bind_error;
+ int bind_error = 0;
for (rp = result; rp; rp = rp->ai_next)
{
if ((bind_error = ::bind(this->socket,