]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
common: cleanup address_helper 19643/head
authorShinobu Kinjo <shinobu@redhat.com>
Fri, 22 Dec 2017 03:42:28 +0000 (22:42 -0500)
committerShinobu Kinjo <shinobu@redhat.com>
Fri, 22 Dec 2017 03:42:28 +0000 (22:42 -0500)
Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
src/common/address_helper.cc

index 09ec805bce27a8a56dcfa65bdb84be871c7896b5..7ea9701e142eee5d60edcbc91fcd86acf10b527f 100644 (file)
@@ -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);