index 3601cdd4faeaca05e0e1fcb016388a29e63df18d..31e10438a786e03eca289dc1802fca4e83e364c4 100644 (file)
Tobias Oetiker <tobi@oetiker.ch>
=cut
Tobias Oetiker <tobi@oetiker.ch>
=cut
+
#' this is to make cperl.el happy
use strict;
#' this is to make cperl.el happy
use strict;
sub end ();
sub read ();
sub end ();
sub read ();
-$VERSION=1.299907080300;
+$VERSION=1.3002;
sub start ($){
croak "rrdtool is already running"
sub start ($){
croak "rrdtool is already running"
my $buffer;
my $nfound;
my $timeleft;
my $buffer;
my $nfound;
my $timeleft;
- my $ERR = 0;
vec($inmask,fileno(RRDreadHand),1) = 1; # setup select mask for Reader
while (1) {
my $rout;
vec($inmask,fileno(RRDreadHand),1) = 1; # setup select mask for Reader
while (1) {
my $rout;
$RRDp::error = undef;
if ($line =~ m|^ERROR|) {
$RRDp::error_mode eq 'catch' ? $RRDp::error = $line : croak $line;
$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);
($RRDp::sys,$RRDp::user,$RRDp::real)=($1,$2,$3);
- return $ERR == 1 ? undef : \$buffer;
+ return \$buffer;
} else {
$buffer .= $line. "\n";
}
} else {
$buffer .= $line. "\n";
}