From 16846f2f34611a42268db7da42b9b8a33d77cd99 Mon Sep 17 00:00:00 2001 From: teastep Date: Thu, 22 Mar 2007 18:46:19 +0000 Subject: [PATCH] Add END block git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@5629 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- New/Shorewall/Chains.pm | 2 +- New/Shorewall/Common.pm | 16 +++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/New/Shorewall/Chains.pm b/New/Shorewall/Chains.pm index 3facf2530..32e2efb06 100644 --- a/New/Shorewall/Chains.pm +++ b/New/Shorewall/Chains.pm @@ -1256,7 +1256,7 @@ sub create_netfilter_load() { if ( $slowstart ) { emit 'TEMPFILE=$(mktempfile)'; emit ''; - emit 'exec 3>>$OUTPUT'; + emit 'exec 3>>$TEMPFILE'; } else { emit 'iptables-restore << __EOF__'; $state = CAT_STATE; diff --git a/New/Shorewall/Common.pm b/New/Shorewall/Common.pm index 16773cd75..97fe0a970 100644 --- a/New/Shorewall/Common.pm +++ b/New/Shorewall/Common.pm @@ -94,13 +94,6 @@ sub warning_message sub fatal_error { print STDERR " ERROR: @_\n"; - - if ( $object ) { - close $object; - unlink $tempfile; - } - - system "rm -rf $ENV{TMP_DIR}" if $ENV{TMP_DIR}; die; } @@ -283,4 +276,13 @@ 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}; +} + 1;