Make iptables-restore usable over a pipe
PATCH 1/4 Make iptables-restore usable over a pipe
The attached patch flushes stdout between commands to make output operations (-L etc) in iptables-restore usable over a pipe. stdio by defaut buffers output if not connected to a terminal.
Regards
Henrik
ip6tables-restore.c +1 -0
@@ -436,6 +436,7 @@ int main(int argc, char *argv[]) &newargv[2], &handle);free_argv (); +fflush (stdout); }if (!ret) { fprintf(stderr, "%s: line %u failed\n",
iptables-restore.c +1 -0
@@ -442,6 +442,7 @@ main(int argc, char *argv[]) &newargv[2], &handle);free_argv (); +fflush (stdout); }if (tablename && (strcmp (tablename, curtable) !=0 ))continue ;
Patrick McHardy
AppliedQuoted 3 lines · Henrik Nordstrom
The attached patch flushes stdout between commands to make output operations (-L etc) in iptables-restore usable over a pipe. stdio by defaut buffers output if not connected to a terminal.
Applied, thanks.