From 3339ce2cc0be9cc15a6cd9571025846edd1bef20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Mon, 23 Sep 2019 22:17:27 +0200 Subject: Trivial little naming changes --- src/network/tcp_client_socket_handler.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/network') diff --git a/src/network/tcp_client_socket_handler.cpp b/src/network/tcp_client_socket_handler.cpp index 9dda73d..6f67f02 100644 --- a/src/network/tcp_client_socket_handler.cpp +++ b/src/network/tcp_client_socket_handler.cpp @@ -46,15 +46,14 @@ void TCPClientSocketHandler::init_socket(const struct addrinfo* rp) else { utils::ScopeGuard sg([result](){ freeaddrinfo(result); }); - struct addrinfo* rp; - for (rp = result; rp; rp = rp->ai_next) + for (; result; result = result->ai_next) { if ((::bind(this->socket, - reinterpret_cast(rp->ai_addr), - rp->ai_addrlen)) == 0) + reinterpret_cast(result->ai_addr), + result->ai_addrlen)) == 0) break; } - if (!rp) + if (!result) log_error("Failed to bind socket to ", this->bind_addr, ": ", strerror(errno)); else -- cgit v1.2.3