From: Jan Engelhardt Date: Thu, 12 Feb 2009 00:28:35 +0000 (+0100) Subject: libxtables: flush before fork X-Git-Tag: v1.4.3~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c19f880d8aac7c0372381e29d7cea09accd0db26;p=thirdparty%2Fiptables.git libxtables: flush before fork Reference: http://bugs.debian.org/514869 Signed-off-by: Jan Engelhardt --- 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;