提交 06f5881b 编写于 作者: R robm

7166687: InetAddress.getLocalHost().getHostName() returns FQDN

Reviewed-by: chegar
上级 68e7bf17
/*
* 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.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册