]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
fix for systems without gethostbyname_r()
authorDaniel Stenberg <daniel@haxx.se>
Thu, 24 Jun 2004 11:58:43 +0000 (11:58 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 24 Jun 2004 11:58:43 +0000 (11:58 +0000)
lib/hostip4.c

index cdc01a47c7a7031b54af022af742267460c14924..284ed0b7c4830d7d0492789109d4e8a161386e29 100644 (file)
@@ -355,13 +355,10 @@ Curl_addrinfo *Curl_getaddrinfo(struct connectdata *conn,
       infof(data, "gethostbyname(2) failed for %s\n", hostname);
     else {
       /*
-       * Copy the hostent struct right here, as the static one we got a
-       * pointer to might get removed when we don't want/expect that. Windows
-       * (other platforms?) also doesn't allow passing of the returned data
-       * between threads, which thus the copying here them allows the app to
-       * do.
+       * Translate the hostent to Curl_addrinfo and return the allocated
+       * data.
        */
-      return Curl_addrinfo_copy(h);
+      return Curl_addrinfo_copy(h, port);
     }
 #endif /*HAVE_GETHOSTBYNAME_R */
   }