]> granicus.if.org Git - icinga2/commitdiff
Fix Utility::GetFQDN() on OS X
authorGunnar Beutner <gunnar@beutner.name>
Wed, 29 Oct 2014 15:54:33 +0000 (16:54 +0100)
committerGunnar Beutner <gunnar@beutner.name>
Wed, 29 Oct 2014 15:54:33 +0000 (16:54 +0100)
fixes #7495

lib/base/utility.cpp

index 14eeb5bb591e2b54f442ccbe4345fb868fa46066..d9ab7a1541c5e43b92c523816c404c4da79cd8dc 100644 (file)
@@ -1024,18 +1024,14 @@ String Utility::GetFQDN(void)
        if (rc != 0)
                result = NULL;
 
-       String canonicalName;
-
        if (result) {
                if (strcmp(result->ai_canonname, "localhost") != 0)
-                       canonicalName = result->ai_canonname;
+                       hostname = result->ai_canonname;
 
                freeaddrinfo(result);
-       } else {
-               canonicalName = hostname;
        }
 
-       return canonicalName;
+       return hostname;
 }
 
 int Utility::Random(void)