This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #37915] Bad select error handling in Net::Ping
authoralexander_bluhm@genua.de <alexander_bluhm@genua.de>
Tue, 13 Dec 2005 10:44:47 +0000 (02:44 -0800)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 15 Dec 2005 14:44:51 +0000 (14:44 +0000)
From: alexander_bluhm@genua.de (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.0.11-37915-125655.19.2646201463531@perl.org>

p4raw-id: //depot/perl@26367

lib/Net/Ping.pm

index bd0855f..fee428c 100644 (file)
@@ -16,7 +16,7 @@ use Carp;
 
 @ISA = qw(Exporter);
 @EXPORT = qw(pingecho);
-$VERSION = "2.31_02";
+$VERSION = "2.31_03";
 
 sub SOL_IP { 0; };
 sub IP_TOS { 1; };
@@ -454,7 +454,7 @@ sub ping_icmp
   {
     $nfound = mselect((my $rout=$rbits), undef, undef, $timeout); # Wait for packet
     $timeout = $finish_time - &time();    # Get remaining time
-    if (!defined($nfound))                # Hmm, a strange error
+    if ($nfound == -1)                    # Hmm, a strange error
     {
       $ret = undef;
       $done = 1;