diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-03-06 15:07:16 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-03-06 15:07:16 +0000 |
commit | 3eea015d78f613c18abb1091eb6797e88ff026d2 (patch) | |
tree | 546b23f5cb6ada0498fe2e975532403fe9693c1a | |
parent | f0a60934402596b7c927e571503b3e6251ca0d6b (diff) | |
download | perl-smoke-me/inet_aton.tar.gz |
Just for smoking - what happens if we enforce the use of getaddrinfo?smoke-me/inet_aton
This will fail to compile on platforms where there is no getaddrinfo.
-rw-r--r-- | ext/Socket/Socket.xs | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/ext/Socket/Socket.xs b/ext/Socket/Socket.xs index 71f0c5746b..e820d48662 100644 --- a/ext/Socket/Socket.xs +++ b/ext/Socket/Socket.xs @@ -422,21 +422,14 @@ inet_aton(host) CODE: { struct in_addr ip_address; - struct hostent * phe; if ((*host != '\0') && inet_aton(host, &ip_address)) { ST(0) = newSVpvn_flags((char *)&ip_address, sizeof ip_address, SVs_TEMP); XSRETURN(1); } - phe = gethostbyname(host); - if (phe && phe->h_addrtype == AF_INET && phe->h_length == 4) { - ST(0) = newSVpvn_flags((char *)phe->h_addr, phe->h_length, SVs_TEMP); - XSRETURN(1); - } - ST(0) = &PL_sv_undef; -#ifdef HAS_GETADDRINFO +#if 1 { struct addrinfo hints = { 0 }; struct addrinfo *result; |