diff options
author | Sergei Golubchik <serg@mariadb.org> | 2016-10-04 16:25:12 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2016-10-04 16:25:12 +0200 |
commit | 0bae1957dd124f8382ae6af1de0e2168fc200bfb (patch) | |
tree | 4e9c8ad3cc514a971922a4aa3cbe6c7aed8218b6 /mysql-test/suite.pm | |
parent | 70dcb46e98e682b6d0c7c3522ddc0ebf0abb70ec (diff) | |
download | mariadb-git-0bae1957dd124f8382ae6af1de0e2168fc200bfb.tar.gz |
simplify the ipv6 check
Diffstat (limited to 'mysql-test/suite.pm')
-rw-r--r-- | mysql-test/suite.pm | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/mysql-test/suite.pm b/mysql-test/suite.pm index 6991ba5f035..cc735638be9 100644 --- a/mysql-test/suite.pm +++ b/mysql-test/suite.pm @@ -56,15 +56,10 @@ sub skip_combinations { sub ipv6_ok() { use Socket; return 0 unless socket my $sock, PF_INET6, SOCK_STREAM, getprotobyname('tcp'); - my $ipv6_works = false; + $!=""; # eval{}, if there's no Socket::sockaddr_in6 at all, old Perl installation <5.14 - eval { - my $addr = sockaddr_in6($baseport, Socket::IN6ADDR_LOOPBACK) or return 0; - die 'bind failed' unless bind $sock, $addr; - close $sock; - $ipv6_works = true; - }; - return $@ eq "" && $ipv6_works; + eval { bind $sock, sockaddr_in6($::baseport, Socket::IN6ADDR_LOOPBACK) }; + return $@ eq "" && $! eq "" } $skip{'include/check_ipv6.inc'} = 'No IPv6' unless ipv6_ok(); |