Use strerror and log_error instead of perrror

This commit is contained in:
Florent Le Coz
2014-02-08 07:59:02 +01:00
parent c8b41d5e35
commit da85617428
2 changed files with 9 additions and 10 deletions
+2 -3
View File
@@ -56,8 +56,7 @@ std::pair<bool, std::string> SocketHandler::connect(const std::string& address,
this->on_connected();
return std::make_pair(true, "");
}
log_info("Connection failed:");
perror("connect");
log_info("Connection failed:" << strerror(errno));
}
log_error("All connection attempts failed.");
this->close();
@@ -97,7 +96,7 @@ void SocketHandler::on_send()
const ssize_t res = ::send(this->socket, this->out_buf.data(), this->out_buf.size(), 0);
if (res == -1)
{
perror("send");
log_error("send failed: " << strerror(errno));
this->close();
}
else