diff options
author | Tobi Oetiker <tobi@oetiker.ch> | 2007-12-21 00:25:04 +0100 |
---|---|---|
committer | Tobi Oetiker <tobi@oetiker.ch> | 2007-12-21 00:25:04 +0100 |
commit | 441d1fe53008898441eddc9289b2e0148bf351d1 (patch) | |
tree | 2ddf410ac7bc4ec0d0968e6fb032001b6c2a0d4d /lib | |
parent | 0898e91fb2a96607fe3919fc2330092a6c63a367 (diff) | |
download | smokeping-441d1fe53008898441eddc9289b2e0148bf351d1.tar.gz smokeping-441d1fe53008898441eddc9289b2e0148bf351d1.tar.xz |
make this work even when no initial file is here
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Smokeping/Master.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm index efe1d9a..945cb78 100644 --- a/lib/Smokeping/Master.pm +++ b/lib/Smokeping/Master.pm @@ -105,11 +105,12 @@ sub save_updates { " in the local data structure. Make sure you run the ". "smokeping daemon. ($cfg->{General}{datadir})\n"; } - elsif ( open (my $hand, '+<', $file) ) { + elsif ( open ($hand, '+>>' , $file) ) { for (my $i = 10; $i < 0; $i--){ if ( flock $hand, LOCK_EX ){ my $existing = []; if ( (stat($hand))[7] > 0 ){ + seek $hand, 0,0; eval { $existing = fd_retrieve $hand }; if ($@) { #error warn "Loading $file: $@"; |