In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5e4d35e6a1433c40af04b9831677295b833a0047?hp=90ae46a10a094e68135385e525c78962d6572da3>
- Log ----------------------------------------------------------------- commit 5e4d35e6a1433c40af04b9831677295b833a0047 Author: Ricardo Signes <[email protected]> Date: Wed Jan 16 08:56:57 2013 -0500 in testing EISDIR string, check known value first It was not enough to ensure the English value, as some platforms use a different string entirely. Rather than goof around with figuring them out, just get the known value by making an EISDIR and stringifying it, then compare to that. M t/run/switches.t commit d335a3e3e857ffce13d73389f7aee93695ffe8e1 Author: Ricardo Signes <[email protected]> Date: Wed Jan 16 10:05:47 2013 -0500 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. M cpan/Socket/Makefile.PL M cpan/Socket/Socket.pm M cpan/Socket/Socket.xs ----------------------------------------------------------------------- Summary of changes: cpan/Socket/Makefile.PL | 2 +- cpan/Socket/Socket.pm | 2 +- cpan/Socket/Socket.xs | 16 ++++++---------- t/run/switches.t | 11 ++++++----- 4 files changed, 14 insertions(+), 17 deletions(-) diff --git a/cpan/Socket/Makefile.PL b/cpan/Socket/Makefile.PL index 99114d2..639a57c 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 acc7bfc..a3a38d9 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 0690435..4bfaada 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))); diff --git a/t/run/switches.t b/t/run/switches.t index c119bee..ea94571 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -14,6 +14,7 @@ BEGIN { require "./test.pl"; } plan(tests => 115); use Config; +use Errno qw(EISDIR); # due to a bug in VMS's piping which makes it impossible for runperl() # to emulate echo -n (ie. stdin always winds up with a newline), these @@ -111,16 +112,16 @@ SWTEST my $tempdir = tempfile; mkdir $tempdir, 0700 or die "Can't mkdir '$tempdir': $!"; + local $ENV{'LC_ALL'} = 'C'; # Keep the test simple: expect English + local $ENV{LANGUAGE} = 'C'; + # Win32 won't let us open the directory, so we never get to die with # EISDIR, which happens after open. + my $eisdir = do { local $! = EISDIR; "$!" }; my $error = $^O eq 'MSWin32' ? 'Permission denied' : 'Is a directory'; - - $ENV{'LC_ALL'} = 'C'; # Keep the test simple: expect English - $ENV{LANGUAGE} = 'C'; - like( runperl( switches => [ '-c' ], args => [ $tempdir ], stderr => 1), - qr/Can't open perl script.*$tempdir.*$error/s, + qr/Can't open perl script.*$tempdir.*\Q$error/s, "RT \#61362: Cannot syntax-check a directory" ); rmdir $tempdir or die "Can't rmdir '$tempdir': $!"; -- Perl5 Master Repository
