Print this page


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