summaryrefslogtreecommitdiffstats
path: root/lib/Tails/Persistence/Configuration/ConfigFile.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Tails/Persistence/Configuration/ConfigFile.pm')
-rw-r--r--lib/Tails/Persistence/Configuration/ConfigFile.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Tails/Persistence/Configuration/ConfigFile.pm b/lib/Tails/Persistence/Configuration/ConfigFile.pm
index 5dd5b2b..27237f7 100644
--- a/lib/Tails/Persistence/Configuration/ConfigFile.pm
+++ b/lib/Tails/Persistence/Configuration/ConfigFile.pm
@@ -85,7 +85,9 @@ Throw exception on error.
=cut
method save () {
my $config_file_was_empty = ! -s $self->config_file_path;
- $self->config_file_path->copy($self->config_file_path . '.bak');
+ unless ($config_file_was_empty) {
+ $self->config_file_path->copy($self->config_file_path . '.bak');
+ }
$self->config_file_path->spew($self->output);
$self->config_file_path->chmod(0600);
# Ensure our changes land on the disk