From: Jarkko Hietaniemi Date: Mon, 18 Feb 2002 02:31:05 +0000 (+0000) Subject: Upgrade to Net::Ping 2.12. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b757f218fef3c38b1bfda5349558f9bbf1b26648;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Net::Ping 2.12. p4raw-id: //depot/perl@14738 --- diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm index 3d3ab76..e81c997 100644 --- a/lib/Net/Ping.pm +++ b/lib/Net/Ping.pm @@ -1,6 +1,6 @@ package Net::Ping; -# $Id: Ping.pm,v 1.16 2002/01/05 23:36:54 rob Exp $ +# $Id: Ping.pm,v 1.17 2002/02/18 01:25:11 rob Exp $ require 5.002; require Exporter; @@ -12,10 +12,11 @@ use FileHandle; use Socket qw( SOCK_DGRAM SOCK_STREAM SOCK_RAW PF_INET inet_aton sockaddr_in ); use Carp; +use Errno qw(ECONNREFUSED); @ISA = qw(Exporter); @EXPORT = qw(pingecho); -$VERSION = "2.11"; +$VERSION = "2.12"; # Constants @@ -333,9 +334,10 @@ sub ping_tcp my ($ret # The return value ); - $@ = ""; + $@ = ""; $! = 0; $ret = $self -> tcp_connect( $ip, $timeout); - $ret = 1 if $@ =~ /(Connection Refused|Unknown Error)/i; + $ret = 1 if $! == ECONNREFUSED # Connection refused + || $@ =~ /Unknown Error/i; # Special Win32 response? $self->{"fh"}->close(); return($ret); } @@ -634,7 +636,7 @@ __END__ Net::Ping - check a remote host for reachability -$Id: Ping.pm,v 1.16 2002/01/05 23:36:54 rob Exp $ +$Id: Ping.pm,v 1.17 2002/02/18 01:25:11 rob Exp $ =head1 SYNOPSIS diff --git a/lib/Net/Ping/CHANGES b/lib/Net/Ping/CHANGES index 65b03ed..172692d 100644 --- a/lib/Net/Ping/CHANGES +++ b/lib/Net/Ping/CHANGES @@ -1,6 +1,13 @@ CHANGES ------- +2.12 Feb 17 19:00 2002 + - More general error determination for + better cross platform consistency and + foreign language support. + Spotted by arnaud@romeconcept.com + - Test changes for VMS (Craig Berry) + 2.11 Feb 02 12:00 2002 - Test changes in case echo port is not available. - Fix 110_icmp_inst.t to use icmp protocol diff --git a/lib/Net/Ping/README b/lib/Net/Ping/README index bde09f0..5e7d055 100644 --- a/lib/Net/Ping/README +++ b/lib/Net/Ping/README @@ -1,7 +1,7 @@ NAME Net::Ping - check a remote host for reachability - $Id: Ping.pm,v 1.16 2002/01/05 23:36:54 rob Exp $ + $Id: Ping.pm,v 1.17 2002/02/18 01:25:11 rob Exp $ SYNOPSIS use Net::Ping; diff --git a/lib/Net/Ping/t/110_icmp_inst.t b/lib/Net/Ping/t/110_icmp_inst.t index 9553f84..bf27289 100644 --- a/lib/Net/Ping/t/110_icmp_inst.t +++ b/lib/Net/Ping/t/110_icmp_inst.t @@ -15,7 +15,9 @@ plan tests => 2; # Everything loaded fine ok 1; -if ($> and $^O ne 'VMS') { +if (($> and $^O ne 'VMS') + or ($^O eq 'VMS' + and (`write sys\$output f\$privilege("SYSPRV")` =~ m/FALSE/))) { skip "icmp ping requires root privileges.", 1; } else { my $p = new Net::Ping "icmp";