summaryrefslogtreecommitdiff
path: root/lib/Net
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-02-18 02:31:05 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-02-18 02:31:05 +0000
commitb757f218fef3c38b1bfda5349558f9bbf1b26648 (patch)
tree7fa4ae594025bf91d0a3a1f95cc4297bed62a933 /lib/Net
parent2f9475adf7d7a036b9b8c1a129175e296141ec5c (diff)
downloadperl-b757f218fef3c38b1bfda5349558f9bbf1b26648.tar.gz
Upgrade to Net::Ping 2.12.
p4raw-id: //depot/perl@14738
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/Ping.pm12
-rw-r--r--lib/Net/Ping/CHANGES7
-rw-r--r--lib/Net/Ping/README2
-rw-r--r--lib/Net/Ping/t/110_icmp_inst.t4
4 files changed, 18 insertions, 7 deletions
diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm
index 3d3ab76842..e81c997eda 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 65b03ed28e..172692d182 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 bde09f00a8..5e7d0553ef 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 9553f845ce..bf27289163 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";