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
This commit is contained in:
teastep 2007-03-29 20:47:14 +00:00
parent fd9be10455
commit 25056dc4fb
3 changed files with 5 additions and 7 deletions

View File

@ -80,8 +80,6 @@ my $indent = '';
my ( $dir, $file ); # Object's Directory and File my ( $dir, $file ); # Object's Directory and File
my $tempfile; # Temporary File Name my $tempfile; # Temporary File Name
my $exitstatus = 0;
# #
# Fatal Error # Fatal Error
# #
@ -89,8 +87,6 @@ sub fatal_error
{ {
print STDERR " ERROR: @_\n"; print STDERR " ERROR: @_\n";
$exitstatus = 1;
exit 1; exit 1;
} }
@ -343,6 +339,8 @@ END {
unlink $tempfile; unlink $tempfile;
} }
my $exitstatus = $?; #Get's changed by system()
system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR}; system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR};
$? = $exitstatus; $? = $exitstatus;

View File

@ -237,9 +237,9 @@ sub warning_message
sub fatal_error { sub fatal_error {
if ( $currentfile ) { if ( $currentfile ) {
Shorewall::Common::fatal_error "@_ : $currentfilename#$currentlinenumber"; print STDERR " ERROR: @_ : $currentfilename#$currentlinenumber\n";
} else { } else {
Shorewall::Common::fatal_error @_; print STDERR " ERROR: @_\n";
} }
exit 1; exit 1;

View File

@ -211,7 +211,7 @@ stop_firewall() {
} }
case $COMMAND in case $COMMAND in
stop|clear) stop|clear|restore)
;; ;;
*) *)
set +x set +x