summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-02-12 01:28:35 +0100
committerJan Engelhardt <jengelh@medozas.de>2009-02-12 07:15:07 +0100
commitc19f880d8aac7c0372381e29d7cea09accd0db26 (patch)
treecd2360ee889a96550aa2fd343174fb936f7ab854
parent37b4bde745698bf140d74e59a2561f34deeb8726 (diff)
libxtables: flush before fork
Reference: http://bugs.debian.org/514869 Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--xtables.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xtables.c b/xtables.c
index 02bfc17a..d85e6390 100644
--- a/xtables.c
+++ b/xtables.c
@@ -272,6 +272,12 @@ int xtables_insmod(const char *modname, const char *modprobe, bool quiet)
modprobe = buf;
}
+ /*
+ * Need to flush the buffer, or the child may output it again
+ * when switching the program thru execv.
+ */
+ fflush(stdout);
+
switch (fork()) {
case 0:
argv[0] = (char *)modprobe;