Trivial little naming changes

This commit is contained in:
louiz’
2019-09-23 22:17:27 +02:00
parent b7b54d8f0e
commit 3339ce2cc0
4 changed files with 10 additions and 11 deletions
+4 -5
View File
@@ -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<const struct sockaddr*>(rp->ai_addr),
rp->ai_addrlen)) == 0)
reinterpret_cast<const struct sockaddr*>(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