Print this page


Split Close
Expand all
Collapse all
          --- old/src/solaris/native/java/net/Inet6AddressImpl.c
          +++ new/src/solaris/native/java/net/Inet6AddressImpl.c
↓ open down ↓ 56 lines elided ↑ open up ↑
  57   57  /*
  58   58   * Class:     java_net_Inet6AddressImpl
  59   59   * Method:    getLocalHostName
  60   60   * Signature: ()Ljava/lang/String;
  61   61   */
  62   62  JNIEXPORT jstring JNICALL
  63   63  Java_java_net_Inet6AddressImpl_getLocalHostName(JNIEnv *env, jobject this) {
  64   64      char hostname[NI_MAXHOST+1];
  65   65  
  66   66      hostname[0] = '\0';
  67      -    if (JVM_GetHostName(hostname, MAXHOSTNAMELEN)) {
       67 +    if (JVM_GetHostName(hostname, sizeof(hostname))) {
  68   68          /* Something went wrong, maybe networking is not setup? */
  69   69          strcpy(hostname, "localhost");
  70   70      } else {
  71   71  #ifdef __linux__
  72   72          /* On Linux gethostname() says "host.domain.sun.com".  On
  73   73           * Solaris gethostname() says "host", so extra work is needed.
  74   74           */
  75   75  #else
  76   76          /* Solaris doesn't want to give us a fully qualified domain name.
  77   77           * We do a reverse lookup to try and get one.  This works
↓ open down ↓ 638 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX