Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

Commit

Permalink
IO-1.39_02
Browse files Browse the repository at this point in the history
Skip EINVAL on FreeBSD tests when binding a tcp listener on localhost.
  • Loading branch information
rurban committed Apr 1, 2019
1 parent f375173 commit c495c3e
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/IO/IO.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use XSLoader ();
use strict;
use warnings;

our $VERSION = "1.39_01";
our $VERSION = "1.39_02";
our $XS_VERSION = $VERSION;
$VERSION = eval $VERSION;
XSLoader::load 'IO', $XS_VERSION;
Expand Down
18 changes: 14 additions & 4 deletions dist/IO/t/io_multihomed.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!./perl

use Config;

BEGIN {
require($ENV{PERL_CORE} ? '../../t/test.pl' : './t/test.pl');

use Config;
my $can_fork = $Config{d_fork} ||
(($^O eq 'MSWin32' || $^O eq 'NetWare') and
$Config{useithreads} and
Expand All @@ -24,7 +24,6 @@ BEGIN {

$| = 1;

print "1..8\n";
watchdog(15);

package Multi;
Expand Down Expand Up @@ -73,13 +72,24 @@ sub connect
package main;

use IO::Socket;
# Don't be locale-sensitive
$! = Errno::EINVAL;
my $EINVAL_STR = "$!";

$listen = IO::Socket::INET->new(LocalAddr => 'localhost',
Listen => 2,
Proto => 'tcp',
Timeout => 5,
) or die "$!";
);
unless ($listen) {
if ($^O eq 'freebsd' && $! eq $EINVAL_STR) {
skip_all("tcp listener on localhost disallowed on this $^O");
} else {
die "$!";
}
}

print "1..8\n";
print "ok 1\n";

$port = $listen->sockport;
Expand Down
20 changes: 14 additions & 6 deletions dist/IO/t/io_sock.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use Config;

BEGIN {
require($ENV{PERL_CORE} ? '../../t/test.pl' : './t/test.pl');
my $can_fork = $Config{d_fork} ||
(($^O eq 'MSWin32' || $^O eq 'NetWare') and
$Config{useithreads} and
Expand All @@ -18,32 +19,39 @@ BEGIN {
elsif (!$can_fork) {
$reason = 'no fork';
}
if ($reason) {
print "1..0 # Skip: $reason\n";
exit 0;
}
skip_all($reason) if $reason;
}

my $has_perlio = find PerlIO::Layer 'perlio';

$| = 1;
print "1..26\n";

eval {
$SIG{ALRM} = sub { die; };
alarm 120;
};

use IO::Socket;
# Don't be locale-sensitive
$! = Errno::EINVAL;
my $EINVAL_STR = "$!";

$listen = IO::Socket::INET->new(LocalAddr => 'localhost',
Listen => 2,
Proto => 'tcp',
# some systems seem to need as much as 10,
# so be generous with the timeout
Timeout => 15,
) or die "$!";
);
unless ($listen) {
if ($^O eq 'freebsd' && $! eq $EINVAL_STR) {
skip_all("tcp listener on localhost disallowed on this $^O");
} else {
die "$!";
}
}

print "1..26\n";
print "ok 1\n";

# Check if can fork with dynamic extensions (bug in CRT):
Expand Down
1 change: 1 addition & 0 deletions dist/Module-CoreList/lib/Module/CoreList.pm
Original file line number Diff line number Diff line change
Expand Up @@ -18411,6 +18411,7 @@ our %delta :const = (
'B::Op_private' => '5.029002',
'Module::CoreList' => '5.20190313c',
'Module::CoreList::Utils'=> '5.20190313c',
'IO' => '1.39_02',
'IO::Socket::IP' => '0.39_03',
'Net::Ping' => '2.72',
},
Expand Down
4 changes: 4 additions & 0 deletions pod/perlcdelta.pod
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,10 @@ XXX

Add the FREEBSD_KERNEL_VERSION key for FreeBSD.

=item L<IO> 1.39_02

Skip EINVAL on FreeBSD tests when binding a tcp listener on localhost.

=item L<IO::Socket::IP> 0.39_03

Allow ETIMEDOUT on FreeBSD INET6 socket with V6Only true.
Expand Down

0 comments on commit c495c3e

Please sign in to comment.