Subject: | bug-Net-Ping-External [at] rt.cpan.org |
Date: | Tue, 06 Nov 2007 16:42:38 -0500 |
To: | bug-Net-Ping-External [...] rt.cpan.org |
From: | dookie <dookie22 [...] knology.net> |
Problem using timeout in Debian
ie..(timeout => 2)
The time out does not work when the program selects "linux" as the
%dispatch hash variable.
I was able to correct this by adding " -W $args{timeout}" to the end of
the /$command /variable.
The Section of code within "perl/5.8.4/Net/Ping/External.pm" that
contains the code that I changed is listed below.
The changes that were added are in bold...
# Debian 2.2 OK, RedHat 6.2 OK
# -s size option available to superuser... FIXME?
sub _ping_linux {
my %args = @_;
my $command;
#for next version
# if (-e '/etc/redhat-release' || -e '/etc/SuSE-release') {
# $command = "ping -c $args{count} -s $args{size} $args{host}";
# } else {
$command = "ping -c $args{count} $args{host} *-W $args{timeout}*";
print "C: $args{timeout}";
# }
return _ping_system($command, 0);
}
This is perl, v5.8.4 built for i386-linux-thread-multi
Linux 2.4.27-2-386 #1 Wed Aug 17 09:33:35 UTC 2005 i686 GNU/Linux
Debian