for portability reasons: s/inet_pton/Curl_inet_pton/

This commit is contained in:
Yang Tse 2009-02-28 01:35:53 +00:00
parent df07537ccf
commit 8d78a33e60

View File

@ -87,6 +87,7 @@
#include "multiif.h"
#include "sockaddr.h" /* required for Curl_sockaddr_storage */
#include "inet_ntop.h"
#include "inet_pton.h"
#include "sslgen.h" /* for Curl_ssl_check_cxn() */
/* The last #include file should be: */
@ -383,8 +384,8 @@ static CURLcode bindlocal(struct connectdata *conn,
if(done > 0) {
#ifdef ENABLE_IPV6
/* ipv6 address */
if ( (af == AF_INET6) &&
inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0 ) {
if((af == AF_INET6) &&
(Curl_inet_pton(AF_INET6, myhost, &si6->sin6_addr) > 0)) {
si6->sin6_family = AF_INET6;
si6->sin6_port = htons(port);
sizeof_sa = sizeof(struct sockaddr_in6);
@ -392,7 +393,8 @@ static CURLcode bindlocal(struct connectdata *conn,
else
#endif
/* ipv4 address */
if ( af == AF_INET && inet_pton(AF_INET, myhost, &si4->sin_addr) > 0 ) {
if((af == AF_INET) &&
(Curl_inet_pton(AF_INET, myhost, &si4->sin_addr) > 0)) {
si4->sin_family = AF_INET;
si4->sin_port = htons(port);
sizeof_sa = sizeof(struct sockaddr_in);