From daadb26ae52c23924ec9c0094e12d7a5d7499a41 Mon Sep 17 00:00:00 2001 From: Arne Juul Date: Fri, 8 Sep 2017 08:05:55 +0000 Subject: use Defaults::vespaHostname --- vespalib/src/vespa/vespalib/util/host_name.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'vespalib') diff --git a/vespalib/src/vespa/vespalib/util/host_name.cpp b/vespalib/src/vespa/vespalib/util/host_name.cpp index a33f81b068f..98ac2c80183 100644 --- a/vespalib/src/vespa/vespalib/util/host_name.cpp +++ b/vespalib/src/vespa/vespalib/util/host_name.cpp @@ -1,21 +1,14 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include "host_name.h" -#include -#include +#include namespace vespalib { namespace { vespalib::string make_host_name() { - constexpr size_t max_size = 1024; - char hostname[max_size + 1]; - memset(hostname, 0, sizeof(hostname)); - if (gethostname(hostname, max_size) != 0) { - throw FatalException("gethostname failed"); - } - return hostname; + return vespa::Defaults::vespaHostname(); } } // namespace vespalib:: -- cgit v1.2.3