changeset 4989:9bf4105ce716

7166687: InetAddress.getLocalHost().getHostName() returns FQDN Reviewed-by: chegar
author robm
date Tue, 15 May 2012 21:35:43 +0100
parents b5b68b7b6aa6
children 20171c9ae8eb
files src/solaris/native/java/net/Inet6AddressImpl.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/solaris/native/java/net/Inet6AddressImpl.c	Tue May 15 17:29:34 2012 +0400
+++ b/src/solaris/native/java/net/Inet6AddressImpl.c	Tue May 15 21:35:43 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.
          */