From 73fb8150992d02888d083581e86b83002e0050c8 Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Thu, 6 Mar 2008 06:21:12 +0000 Subject: fix retrun value processing (regression from last patch) --- lib/Smokeping.pm | 3 ++- lib/Smokeping/Master.pm | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/Smokeping.pm b/lib/Smokeping.pm index b3e37b9..ce9d8db 100644 --- a/lib/Smokeping.pm +++ b/lib/Smokeping.pm @@ -1856,7 +1856,8 @@ sub update_rrds($$$$$$) { if ($tree->{slaves}){ my @slaves = split(/\s+/, $tree->{slaves}); foreach my $slave (@slaves) { - push @updates, Smokeping::Master::get_slaveupdates($name, $slave); + my $lines = Smokeping::Master::get_slaveupdates($name, $slave); + push @updates, @$lines; } #foreach my $checkslave } for my $update (sort {$a->[1] <=> $b->[1]} @updates){ # make sure we put the updates in chronological order in diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm index d31c95b..f359998 100644 --- a/lib/Smokeping/Master.pm +++ b/lib/Smokeping/Master.pm @@ -143,7 +143,7 @@ sub get_slaveupdates { my $name = shift; my $slave = shift; my $file = $name . "." . $slave. ".slave_cache"; - my @empty = (); + my $empty = []; my $data; if ( -r $file and open (my $lock, '>>', "$file.lock") ) { if ( flock $lock, LOCK_EX ){ @@ -151,7 +151,7 @@ sub get_slaveupdates { unlink $file; if ($@) { #error warn "Loading $file: $@"; - return @empty; + return $empty; } } else { warn "Could not lock $file. Will skip and try again in the next round. No harm done!\n"; @@ -159,7 +159,7 @@ sub get_slaveupdates { close $lock; return $data; } - return @empty; + return $empty; } -- cgit v1.2.3-24-g4f1b