From: Jarkko Hietaniemi Date: Sun, 5 May 2002 01:53:24 +0000 (+0000) Subject: Upgrade to Net::Ping 2.17. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ef73e1dbcc1c9fa8d7d2ed6d1e805a92a117062b;p=p5sagit%2Fp5-mst-13.2.git Upgrade to Net::Ping 2.17. p4raw-id: //depot/perl@16409 --- diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm index 6c61a47..f689047 100644 --- a/lib/Net/Ping.pm +++ b/lib/Net/Ping.pm @@ -1,6 +1,6 @@ package Net::Ping; -# $Id: Ping.pm,v 1.31 2002/04/11 16:45:06 rob Exp $ +# $Id: Ping.pm,v 1.33 2002/05/03 21:54:59 rob Exp $ require 5.002; require Exporter; @@ -12,11 +12,11 @@ use FileHandle; use Socket qw( SOCK_DGRAM SOCK_STREAM SOCK_RAW PF_INET inet_aton inet_ntoa sockaddr_in ); use Carp; -use Errno qw(ECONNREFUSED); +use POSIX qw(ECONNREFUSED); @ISA = qw(Exporter); @EXPORT = qw(pingecho); -$VERSION = "2.16"; +$VERSION = "2.17"; # Constants @@ -26,6 +26,12 @@ $max_datasize = 1024; # Maximum data bytes in a packet # The data we exchange with the server for the stream protocol $pingstring = "pingschwingping!\n"; +if ($^O =~ /Win32/i) { + # Hack to avoid this Win32 spewage: + # Your vendor has not defined POSIX macro ECONNREFUSED + *ECONNREFUSED = sub {10061;}; # "Unknown Error" Special Win32 Response? +}; + # Description: The pingecho() subroutine is provided for backward # compatibility with the original Net::Ping. It accepts a host # name/IP and an optional timeout in seconds. Create a tcp ping @@ -367,8 +373,7 @@ sub ping_tcp $@ = ""; $! = 0; $ret = $self -> tcp_connect( $ip, $timeout); - $ret = 1 if $! == ECONNREFUSED # Connection refused - || $@ =~ /Unknown Error/i; # Special Win32 response? + $ret = 1 if $! == ECONNREFUSED; # Connection refused $self->{"fh"}->close(); return $ret; } @@ -667,7 +672,7 @@ __END__ Net::Ping - check a remote host for reachability -$Id: Ping.pm,v 1.31 2002/04/11 16:45:06 rob Exp $ +$Id: Ping.pm,v 1.33 2002/05/03 21:54:59 rob Exp $ =head1 SYNOPSIS diff --git a/lib/Net/Ping/CHANGES b/lib/Net/Ping/CHANGES index 8bf3c91..86060b6 100644 --- a/lib/Net/Ping/CHANGES +++ b/lib/Net/Ping/CHANGES @@ -1,6 +1,12 @@ CHANGES ------- +2.17 May 03 18:00 2002 + - RPM spec generalizations. + michael.mclagan@linux.org (Michael McLagan) + - Win32 compatibility changes. + (Didn't compile on Win32 since v2.11.) + 2.16 Apr 11 14:00 2002 - Documentation changes. - Added INSTALL doc. diff --git a/lib/Net/Ping/README b/lib/Net/Ping/README index ff39739..2b18447 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.31 2002/04/11 16:45:06 rob Exp $ + $Id: Ping.pm,v 1.33 2002/05/03 21:54:59 rob Exp $ SYNOPSIS use Net::Ping;