7166687: InetAddress.getLocalHost().getHostName() returns FQDN
authorrobm
Mon, 07 May 2012 13:34:19 +0100
changeset 12673 6f77a4af6348
parent 12672 6daea025e1dd
child 12674 5f9829b7fc7e
7166687: InetAddress.getLocalHost().getHostName() returns FQDN Reviewed-by: chegar
jdk/src/solaris/native/java/net/Inet6AddressImpl.c
--- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c	Mon May 07 16:43:16 2012 +0800
+++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c	Mon May 07 13:34:19 2012 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -73,7 +73,7 @@
     } else {
         // ensure null-terminated
         hostname[NI_MAXHOST] = '\0';
-#if defined(__linux__) && defined(_ALLBSD_SOURCE)
+#if defined(__linux__) || defined(_ALLBSD_SOURCE)
         /* On Linux/FreeBSD gethostname() says "host.domain.sun.com".  On
          * Solaris gethostname() says "host", so extra work is needed.
          */