* [patch 1/4] Make iptables-restore usable over a pipe
@ 2008-05-12 18:20 Henrik Nordstrom
2008-05-12 18:39 ` Patrick McHardy
0 siblings, 1 reply; 2+ messages in thread
From: Henrik Nordstrom @ 2008-05-12 18:20 UTC (permalink / raw)
To: netfilter-devel
[-- Attachment #1: Type: text/plain, Size: 205 bytes --]
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
[-- Attachment #2: iptables-restore-pipe.patch --]
[-- Type: text/x-patch, Size: 726 bytes --]
Index: iptables/ip6tables-restore.c
===================================================================
--- iptables.orig/ip6tables-restore.c
+++ iptables/ip6tables-restore.c
@@ -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",
Index: iptables/iptables-restore.c
===================================================================
--- iptables.orig/iptables-restore.c
+++ iptables/iptables-restore.c
@@ -442,6 +442,7 @@ main(int argc, char *argv[])
&newargv[2], &handle);
free_argv();
+ fflush(stdout);
}
if (tablename && (strcmp(tablename, curtable) != 0))
continue;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch 1/4] Make iptables-restore usable over a pipe
2008-05-12 18:20 [patch 1/4] Make iptables-restore usable over a pipe Henrik Nordstrom
@ 2008-05-12 18:39 ` Patrick McHardy
0 siblings, 0 replies; 2+ messages in thread
From: Patrick McHardy @ 2008-05-12 18:39 UTC (permalink / raw)
To: Henrik Nordstrom; +Cc: netfilter-devel
Henrik Nordstrom wrote:
> 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-12 18:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-12 18:20 [patch 1/4] Make iptables-restore usable over a pipe Henrik Nordstrom
2008-05-12 18:39 ` Patrick McHardy
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.