Skip to contentSkip to conversation

conntrack: flush stdout for each expectation event, too

PATCH Applied Florian Westphal 2 participants 2 messages May 18, 2012 – May 20, 2012 netfilter

lore
Share & tools
lore

Florian Westphal

author maintainer
#0 lore raw

PATCH 1/1 conntrack: flush stdout for each expectation event, too

else, piping "conntrack -E expect" output will be buffered/delayed, which is not what users expect. Normal conntrack events are already flushed.

---
 src/conntrack.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
src/conntrack.c +1 -0
index b065211..0920bc5 100644
@@ -1380,6 +1380,7 @@ static int event_exp_cb(enum nf_conntrack_msg_type type,
 
 	nfexp_snprintf(buf,sizeof(buf), exp, type, op_type, op_flags);
 	printf("%s\n", buf);
+	fflush(stdout);
 	counter++;
 
 	return NFCT_CB_CONTINUE;
Signature · 1 line
1.7.3.4
maintainer Applied
#1 lore raw
Quoted 3 lines · Florian Westphal

else, piping "conntrack -E expect" output will be buffered/delayed, which is not what users expect. Normal conntrack events are already flushed.

applied, thanks Florian.