summaryrefslogtreecommitdiffstats
path: root/util/system/hostname.cpp
diff options
context:
space:
mode:
authorAlexey Borzenkov <[email protected]>2022-02-10 16:47:43 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:47:43 +0300
commit330c83f8c116bd45316397b179275e9d87007e7d (patch)
treec0748b5dcbade83af788c0abfa89c0383d6b779c /util/system/hostname.cpp
parent22d92781ba2a10b7fb5b977b7d1a5c40ff53885f (diff)
Restoring authorship annotation for Alexey Borzenkov <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'util/system/hostname.cpp')
-rw-r--r--util/system/hostname.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/system/hostname.cpp b/util/system/hostname.cpp
index a4637404b22..386f646d6bd 100644
--- a/util/system/hostname.cpp
+++ b/util/system/hostname.cpp
@@ -49,13 +49,13 @@ namespace {
hints.ai_flags = AI_CANONNAME;
res = getaddrinfo(buf, nullptr, &hints, &ais);
if (res) {
- if (res != EAI_NONAME) {
- ythrow TSystemError() << "can not get FQDN (return code is " << res << ", hostname is \"" << buf << "\")";
- }
- FQDNHostName = buf;
- } else {
- FQDNHostName = ais->ai_canonname;
- freeaddrinfo(ais);
+ if (res != EAI_NONAME) {
+ ythrow TSystemError() << "can not get FQDN (return code is " << res << ", hostname is \"" << buf << "\")";
+ }
+ FQDNHostName = buf;
+ } else {
+ FQDNHostName = ais->ai_canonname;
+ freeaddrinfo(ais);
}
FQDNHostName.to_lower();
}