Final (FLW) fix for exit status

git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5749 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb
This commit is contained in:
teastep 2007-03-29 20:24:24 +00:00
parent 62285033c9
commit fd9be10455

View File

@ -80,6 +80,8 @@ my $indent = '';
my ( $dir, $file ); # Object's Directory and File
my $tempfile; # Temporary File Name
my $exitstatus = 0;
#
# Fatal Error
#
@ -87,12 +89,7 @@ sub fatal_error
{
print STDERR " ERROR: @_\n";
if ( $object ) {
close $object;
unlink $tempfile;
}
system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR};
$exitstatus = 1;
exit 1;
}
@ -340,4 +337,15 @@ sub finalize_aux_config() {
progress_message3 "Shorewall configuration compiled to $file";
}
END {
if ( $object ) {
close $object;
unlink $tempfile;
}
system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR};
$? = $exitstatus;
}
1;