summaryrefslogtreecommitdiffstats
path: root/vespaclient
diff options
context:
space:
mode:
authorArne Juul <arnej@yahoo-inc.com>2017-09-08 08:05:55 +0000
committerArne Juul <arnej@yahoo-inc.com>2017-09-08 08:05:55 +0000
commitdaadb26ae52c23924ec9c0094e12d7a5d7499a41 (patch)
treefd645b8002a566033a68c21fbf84d922e46ca0a6 /vespaclient
parent5734bcd664f92dd29f40d3cb8fad85547e6c9fef (diff)
use Defaults::vespaHostname
Diffstat (limited to 'vespaclient')
-rw-r--r--vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp b/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp
index 99c91216d20..b24eb3e0373 100644
--- a/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp
+++ b/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp
@@ -1,5 +1,6 @@
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+#include <vespa/defaults.h>
#include <vespa/document/util/stringutil.h>
#include <vespa/fnet/frt/frt.h>
#include <vespa/slobrok/sbmirror.h>
@@ -339,15 +340,7 @@ struct StateApp : public FastOS_Application {
{
indexes.push_back(_options._nodeIndex);
} else {
- std::vector<char> host(HOST_NAME_MAX);
- int result = gethostname(&host[0], host.size());
- if (result != 0) {
- std::cerr << "Failed to retrieve hostname of this node, "
- "thus we cannot figure out what services run "
- "on this node.\n";
- break;
- }
- std::string hostname(&host[0]);
+ std::string hostname(vespa::Defaults::vespaHostname());
FRT_RPCRequest* req = supervisor.AllocRPCRequest();
req->SetMethodName("getNodeList");
target->InvokeSync(req, 10.0);