From 25056dc4fb4c1d6de2fc840d6d775ac5a0cbd25d Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 29 Mar 2007 20:47:14 +0000 Subject: [PATCH] Avoid infinite loop if fatal_error is called when the command is 'restore'; remove hacks from trying to workaround exit status prob git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5750 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Common.pm | 6 ++---- New/Shorewall/Config.pm | 4 ++-- New/compiler.pl | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/New/Shorewall/Common.pm b/New/Shorewall/Common.pm index 40da1f747..5272bbe1e 100644 --- a/New/Shorewall/Common.pm +++ b/New/Shorewall/Common.pm @@ -80,8 +80,6 @@ my $indent = ''; my ( $dir, $file ); # Object's Directory and File my $tempfile; # Temporary File Name -my $exitstatus = 0; - # # Fatal Error # @@ -89,8 +87,6 @@ sub fatal_error { print STDERR " ERROR: @_\n"; - $exitstatus = 1; - exit 1; } @@ -343,6 +339,8 @@ END { unlink $tempfile; } + my $exitstatus = $?; #Get's changed by system() + system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR}; $? = $exitstatus; diff --git a/New/Shorewall/Config.pm b/New/Shorewall/Config.pm index 921f402e0..fffeaa88d 100644 --- a/New/Shorewall/Config.pm +++ b/New/Shorewall/Config.pm @@ -237,9 +237,9 @@ sub warning_message sub fatal_error { if ( $currentfile ) { - Shorewall::Common::fatal_error "@_ : $currentfilename#$currentlinenumber"; + print STDERR " ERROR: @_ : $currentfilename#$currentlinenumber\n"; } else { - Shorewall::Common::fatal_error @_; + print STDERR " ERROR: @_\n"; } exit 1; diff --git a/New/compiler.pl b/New/compiler.pl index 5b69c3be8..440f31b84 100755 --- a/New/compiler.pl +++ b/New/compiler.pl @@ -211,7 +211,7 @@ stop_firewall() { } case $COMMAND in - stop|clear) + stop|clear|restore) ;; *) set +x