src/solaris/native/java/net/Inet4AddressImpl.c

Print this page

        

*** 58,68 **** JNIEXPORT jstring JNICALL Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { char hostname[MAXHOSTNAMELEN+1]; hostname[0] = '\0'; ! if (JVM_GetHostName(hostname, MAXHOSTNAMELEN)) { /* Something went wrong, maybe networking is not setup? */ strcpy(hostname, "localhost"); } else { #ifdef __linux__ /* On Linux gethostname() says "host.domain.sun.com". On --- 58,68 ---- JNIEXPORT jstring JNICALL Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) { char hostname[MAXHOSTNAMELEN+1]; hostname[0] = '\0'; ! if (JVM_GetHostName(hostname, sizeof(hostname))) { /* Something went wrong, maybe networking is not setup? */ strcpy(hostname, "localhost"); } else { #ifdef __linux__ /* On Linux gethostname() says "host.domain.sun.com". On