summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9abfa84)
raw | patch | inline | side by side (parent: 9abfa84)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 4 Nov 2007 21:56:19 +0000 (21:56 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 4 Nov 2007 21:56:19 +0000 (21:56 +0000) |
program/bindings/perl-piped/RRDp.pm | patch | blob | history |
index 3601cdd4faeaca05e0e1fcb016388a29e63df18d..91facb3f6cdf6ba66b6dc7adc0e59a281c0faec6 100644 (file)
my $buffer;
my $nfound;
my $timeleft;
- my $ERR = 0;
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;
- $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";
}