about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>2005-08-03 00:36:14 +0000
committerGraham Barr <gbarr@pobox.com>2009-02-24 10:40:47 -0600
commitca4b6487b2aa70597640d87a18a4ab0df1a3b819 (patch)
tree622e6ac3605375d5cf1dfb6ec5644f98ca92d219
parent3068255c9557cb6891bc82d3117ee7a9c438cb2c (diff)
downloadperl-libnet-ca4b6487b2aa70597640d87a18a4ab0df1a3b819.tar.gz
Silence uninitialized value warnings in Net::Cmd during testing on Win32 (from Steve Hay)
-rw-r--r--Net/Cmd.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/Net/Cmd.pm b/Net/Cmd.pm
index f1e436d..f7c7484 100644
--- a/Net/Cmd.pm
+++ b/Net/Cmd.pm
@@ -21,7 +21,7 @@ BEGIN {
   }
 }
 
-$VERSION = "2.26";
+$VERSION = "2.26_01";
 @ISA     = qw(Exporter);
 @EXPORT  = qw(CMD_INFO CMD_OK CMD_MORE CMD_REJECT CMD_ERROR CMD_PENDING);
 
@@ -431,7 +431,8 @@ sub datasend
  while($len)
   {
    my $wout;
-   if (select(undef,$wout=$win, undef, $timeout) > 0 or -f $cmd) # -f for testing on win32
+   my $s = select(undef,$wout=$win, undef, $timeout);
+   if ((defined $s and $s > 0) or -f $cmd) # -f for testing on win32
     {
      my $w = syswrite($cmd, $line, $len, $offset);
      unless (defined($w))