From: Jo-Philipp Wich Date: Tue, 21 May 2013 14:43:56 +0000 (+0200) Subject: Do not print to pipe or close command if nothing was executed X-Git-Url: http://git.archive.openwrt.org/?a=commitdiff_plain;h=af5aaf31592dc0e25351e366235b355aa1ab6eee;hp=54904110e3122f4fcded32f5ff6ef30f7de7363c;p=project%2Ffirewall3.git Do not print to pipe or close command if nothing was executed --- diff --git a/includes.c b/includes.c index 42d5b7a..5022fbd 100644 --- a/includes.c +++ b/includes.c @@ -135,7 +135,8 @@ fw3_print_includes(struct fw3_state *state, enum fw3_family family, bool reload) print_include(include); } - fw3_command_close(); + if (exec) + fw3_command_close(); } diff --git a/ipsets.c b/ipsets.c index e149b5b..d33873a 100644 --- a/ipsets.c +++ b/ipsets.c @@ -384,8 +384,11 @@ fw3_destroy_ipsets(struct fw3_state *state) fw3_pr("destroy %s\n", ipset->name); } - fw3_pr("quit\n"); - fw3_command_close(); + if (exec) + { + fw3_pr("quit\n"); + fw3_command_close(); + } /* wait for ipsets to disappear */ list_for_each_entry(ipset, &state->ipsets, list)