From 90e0c8b71723dfe6032ff60c414b821919ccf899 Mon Sep 17 00:00:00 2001 From: Tom Eastep Date: Wed, 2 Jan 2013 15:03:07 -0800 Subject: [PATCH] Don't update mtime on shorewall.conf during update that doesn't change the file Signed-off-by: Tom Eastep --- Shorewall/Perl/Shorewall/Config.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Shorewall/Perl/Shorewall/Config.pm b/Shorewall/Perl/Shorewall/Config.pm index 4572dd9f1..2ca1d83c8 100644 --- a/Shorewall/Perl/Shorewall/Config.pm +++ b/Shorewall/Perl/Shorewall/Config.pm @@ -4357,10 +4357,10 @@ EOF if ( system( "diff -q $configfile $configfile.bak > /dev/null" ) ) { progress_message3 "Configuration file $configfile updated - old file renamed $configfile.bak"; } else { - if ( unlink "$configfile.bak" ) { + if ( rename "$configfile.bak", $configfile ) { progress_message3 "No update required to configuration file $configfile; $configfile.bak not saved"; } else { - warning_message "Unable to unlink $configfile.bak"; + warning_message "Unable to rename $configfile.bak to $configfile"; progress_message3 "No update required to configuration file $configfile"; }