aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Pipkin <j@dawnrazor.net>2012-05-30 14:31:44 -0500
committerJacob Pipkin <j@dawnrazor.net>2012-05-30 14:31:44 -0500
commita0ac34529effe5ac75542b6b843aea47e5d2a7b1 (patch)
tree008df7ff3100e6221e2bbb233bdd0b9e4b11db02
parentc64341a1835997d4c19c0682517d134380d58ece (diff)
downloadsbotools2-a0ac34529effe5ac75542b6b843aea47e5d2a7b1.tar.xz
copy conf file to temp file instead of reading conf file and writing its contents to temp file, and remove unneeded "use Fcntl;" line.
-rwxr-xr-xsboconfig4
1 files changed, 1 insertions, 3 deletions
diff --git a/sboconfig b/sboconfig
index 83fdcea..967819b 100755
--- 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;