Commit ec4df6c1 authored by Bjorn Munch's avatar Bjorn Munch

Bug #45771 AIX and i5/OS Perl bug: check_socket_path_length in MTR fails

Bug in Perl
Scrap attempt to do this smartly on AIX, just drop the test and assume it's OK
This commit undoes the previous push and adds a line to ignore on AIX
parent 3b1d4fce
......@@ -106,10 +106,13 @@ sub check_socket_path_length {
my ($path)= @_;
return 0 if IS_WINDOWS;
# This may not be true, but we can't test for it on AIX due to Perl bug
# See Bug #45771
return 0 if ($^O eq 'aix');
require IO::Socket::UNIX;
my $truncated= 1; # Be negative
my $truncated= undef;
# Create a tempfile name with same length as "path"
my $tmpdir = tempdir( CLEANUP => 0);
......@@ -122,32 +125,20 @@ sub check_socket_path_length {
Local => $testfile,
Listen => 1,
);
$truncated= 1; # Be negatvie
die "Could not create UNIX domain socket: $!"
unless defined $sock;
my $hostpath = eval {$sock->hostpath()};
if ($@) {
die unless $@ =~ /^Bad arg length for Socket::unpack_sockaddr_un/;
# Bug on AIX and i5/OS Perl IO::Socket::UNIX which dies with something
# like:
# Bad arg length for Socket::unpack_sockaddr_un, length is 25,
# should be 106 at /path/to/perl/lib/5.8.0/aix/Socket.pm line 380.
#
# Just fake it that everything is fine
$hostpath = $testfile;
}
die "UNIX domain socket path was truncated"
unless ($testfile eq $hostpath);
unless ($testfile eq $sock->hostpath());
$truncated= 0; # Yes, it worked!
};
die "Unexpected failure when checking socket path length: $@"
if $@ and $@ !~ /^UNIX domain socket path was truncated/;
if $@ and not defined $truncated;
$sock= undef; # Close socket
rmtree($tmpdir); # Remove the tempdir and any socket file created
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment