summaryrefslogtreecommitdiffstats
path: root/vespalib
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 /vespalib
parent5734bcd664f92dd29f40d3cb8fad85547e6c9fef (diff)
use Defaults::vespaHostname
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/host_name.cpp11
1 files changed, 2 insertions, 9 deletions
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 <vespa/vespalib/util/exceptions.h>
-#include <unistd.h>
+#include <vespa/defaults.h>
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::<unnamed>