commit a0ac34529effe5ac75542b6b843aea47e5d2a7b1
parent c64341a1835997d4c19c0682517d134380d58ece
Author: Jacob Pipkin <j@dawnrazor.net>
Date: Wed, 30 May 2012 14:31:44 -0500
copy conf file to temp file instead of reading conf file and writing its contents to temp file, and remove unneeded "use Fcntl;" line.
Diffstat:
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/sboconfig b/sboconfig
@@ -14,7 +14,6 @@ use File::Basename;
use Getopt::Std;
use File::Copy;
use File::Path qw(make_path);
-use Fcntl;
my %config = %SBO::Lib::config;
my $self = basename ($0);
@@ -93,9 +92,8 @@ sub config_write {
if (-f $conf_file) {
# get a temp file and fill it with the contents of our config file
my ($fh, $filename) = make_temp_file ();
- open my $reader, '<', $conf_file;
- print {$fh} <$reader>;
close $fh;
+ copy ($conf_file, $filename)
# tie the file so that if $key is already there, we just change that
# line and untie it
tie my @temp, 'Tie::File', $filename;