diff options
author | Ricardo Signes <rjbs@cpan.org> | 2013-01-16 10:05:47 -0500 |
---|---|---|
committer | Ricardo Signes <rjbs@cpan.org> | 2013-01-16 10:06:47 -0500 |
commit | d335a3e3e857ffce13d73389f7aee93695ffe8e1 (patch) | |
tree | 3fce1fe3cf48c9b61e4b8999f677741969fdf6cf /cpan/Socket | |
parent | 90ae46a10a094e68135385e525c78962d6572da3 (diff) | |
download | perl-d335a3e3e857ffce13d73389f7aee93695ffe8e1.tar.gz |
Revert "Upgrade Socket to CPAN version 2.008"
This reverts commit 90ae46a10a094e68135385e525c78962d6572da3.
Socket 2.008 fails to build on Linux in core, and possibly other
platforms as well.
Diffstat (limited to 'cpan/Socket')
-rw-r--r-- | cpan/Socket/Makefile.PL | 2 | ||||
-rw-r--r-- | cpan/Socket/Socket.pm | 2 | ||||
-rw-r--r-- | cpan/Socket/Socket.xs | 16 |
3 files changed, 8 insertions, 12 deletions
diff --git a/cpan/Socket/Makefile.PL b/cpan/Socket/Makefile.PL index 99114d272e..639a57c4d6 100644 --- a/cpan/Socket/Makefile.PL +++ b/cpan/Socket/Makefile.PL @@ -13,7 +13,7 @@ my $seq = 0; sub check_for { my %args = @_; - return if defined $Config{$args{confkey}}; + return if exists $Config{$args{confkey}}; require ExtUtils::CBuilder; $cb ||= ExtUtils::CBuilder->new( quiet => 1 ); diff --git a/cpan/Socket/Socket.pm b/cpan/Socket/Socket.pm index acc7bfcb23..a3a38d9f81 100644 --- a/cpan/Socket/Socket.pm +++ b/cpan/Socket/Socket.pm @@ -3,7 +3,7 @@ package Socket; use strict; { use 5.006001; } -our $VERSION = '2.008'; +our $VERSION = '2.006_001'; =head1 NAME diff --git a/cpan/Socket/Socket.xs b/cpan/Socket/Socket.xs index 069043531f..4bfaada2f1 100644 --- a/cpan/Socket/Socket.xs +++ b/cpan/Socket/Socket.xs @@ -895,7 +895,7 @@ inet_ntop(af, ip_address_sv) SV * ip_address_sv CODE: #ifdef HAS_INETNTOP - STRLEN addrlen; + STRLEN addrlen, struct_size; #ifdef AF_INET6 struct in6_addr addr; char str[INET6_ADDRSTRLEN]; @@ -910,17 +910,19 @@ inet_ntop(af, ip_address_sv) ip_address = SvPV(ip_address_sv, addrlen); + struct_size = sizeof(addr); + switch(af) { case AF_INET: if(addrlen != 4) croak("Bad address length for Socket::inet_ntop on AF_INET;" - " got %"UVuf", should be 4", (UV)addrlen); + " got %d, should be 4", addrlen); break; #ifdef AF_INET6 case AF_INET6: if(addrlen != 16) croak("Bad address length for Socket::inet_ntop on AF_INET6;" - " got %"UVuf", should be 16", (UV)addrlen); + " got %d, should be 16", addrlen); break; #endif default: @@ -933,13 +935,7 @@ inet_ntop(af, ip_address_sv) "Socket::inet_ntop", af); } - if(addrlen < sizeof(addr)) { - Copy(ip_address, &addr, addrlen, char); - Zero(((char*)&addr) + addrlen, sizeof(addr) - addrlen, char); - } - else { - Copy(ip_address, &addr, sizeof addr, char); - } + Copy(ip_address, &addr, sizeof addr, char); inet_ntop(af, &addr, str, sizeof str); ST(0) = sv_2mortal(newSVpvn(str, strlen(str))); |