diff options
Diffstat (limited to 'lib/Smokeping')
-rw-r--r-- | lib/Smokeping/Master.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Smokeping/Master.pm b/lib/Smokeping/Master.pm index e2c50fd..1a12427 100644 --- a/lib/Smokeping/Master.pm +++ b/lib/Smokeping/Master.pm @@ -1,7 +1,7 @@ # -*- perl -*- package Smokeping::Master; use Data::Dumper; -use Storable qw(nstore_fd dclone fd_retrieve); +use Storable qw(nstore dclone fd_retrieve); use strict; use warnings; use Fcntl qw(:flock); @@ -143,8 +143,8 @@ sub save_updates { map { push @{$existing}, [ $slave, $_->[0], $_->[1] ]; } @{$u{$name}}; - seek $fh, 0, 0; - nstore_fd($existing, $fh); + nstore($existing, $file.$$); + rename $file.$$,$file; flock($fh, LOCK_UN); close $fh; last; |