From: Shinobu Kinjo Date: Fri, 22 Dec 2017 03:42:28 +0000 (-0500) Subject: common: cleanup address_helper X-Git-Tag: v13.0.2~698^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F19643%2Fhead;p=ceph.git common: cleanup address_helper Signed-off-by: Shinobu Kinjo --- diff --git a/src/common/address_helper.cc b/src/common/address_helper.cc index 09ec805bce2..7ea9701e142 100644 --- a/src/common/address_helper.cc +++ b/src/common/address_helper.cc @@ -1,3 +1,5 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab /* * address_helper.cc * @@ -15,7 +17,6 @@ int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url) { using namespace boost; - using std::endl; regex expr("(tcp|rdma)://([^:]*):([\\d]+)"); cmatch m; @@ -27,8 +28,7 @@ int entity_addr_from_url(entity_addr_t *addr /* out */, const char *url) memset(&hints, 0, sizeof(hints)); hints.ai_family = PF_UNSPEC; addrinfo *res; - int error = getaddrinfo(host.c_str(), NULL, &hints, &res); - if (! error) { + if (!getaddrinfo(host.c_str(), nullptr, &hints, &res)) { addr->set_sockaddr((sockaddr*)res->ai_addr); addr->set_port(std::atoi(port.c_str())); freeaddrinfo(res);