From fd928bc1ef63ffc6288f83e520ab794814093d4a Mon Sep 17 00:00:00 2001 From: Rob McKenna Date: Mon, 7 May 2012 13:34:19 +0100 Subject: [PATCH] 7166687: InetAddress.getLocalHost().getHostName() returns FQDN Reviewed-by: chegar --- jdk/src/solaris/native/java/net/Inet6AddressImpl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c index e612131b95c..608f3c595d2 100644 --- a/jdk/src/solaris/native/java/net/Inet6AddressImpl.c +++ b/jdk/src/solaris/native/java/net/Inet6AddressImpl.c @@ -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 @@ Java_java_net_Inet6AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { } 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. */