X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=bindings%2Fperl-piped%2FRRDp.pm;h=18151f345da5d6fb206ee229696f4be447d87c42;hb=c24cf5317f753d0bfb376835b4f907462a770384;hp=e61a28be77cf659eb23eafaecc794f309d5c087c;hpb=ec2afe5e94d9fcd72bb58e572f0251c7557325f7;p=rrdtool.git diff --git a/bindings/perl-piped/RRDp.pm b/bindings/perl-piped/RRDp.pm index e61a28b..18151f3 100644 --- a/bindings/perl-piped/RRDp.pm +++ b/bindings/perl-piped/RRDp.pm @@ -120,7 +120,7 @@ sub cmd (@); sub end (); sub read (); -$VERSION=1.2023; +$VERSION=1.299908060801; sub start ($){ croak "rrdtool is already running" @@ -146,7 +146,6 @@ sub read () { my $buffer; my $nfound; my $timeleft; - my $ERR = 0; vec($inmask,fileno(RRDreadHand),1) = 1; # setup select mask for Reader while (1) { my $rout; @@ -163,11 +162,14 @@ sub read () { $RRDp::error = undef; if ($line =~ m|^ERROR|) { $RRDp::error_mode eq 'catch' ? $RRDp::error = $line : croak $line; - $ERR = 1; + $RRDp::sys = undef; + $RRDp::user = undef; + $RRDp::real = undef; + return undef; } - elsif ($line =~ m|^OK u:([\d\.]+) s:([\d\.]+) r:([\d\.]+)|){ + elsif ($line =~ m|^OK(?: u:([\d\.]+) s:([\d\.]+) r:([\d\.]+))?|){ ($RRDp::sys,$RRDp::user,$RRDp::real)=($1,$2,$3); - return $ERR == 1 ? undef : \$buffer; + return \$buffer; } else { $buffer .= $line. "\n"; }