From 8665a86cc2713b9ca8ae036435e61876fc513177 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 2 Oct 2013 08:19:23 +0200 Subject: ifpps: Simplify logic wrt. omit_header in term_main() We can reuse the omit_header variable to get rid of the existing variable 'first', which was used to make sure the header gets only printed once at the beginning. Signed-off-by: Tobias Klauser --- ifpps.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'ifpps.c') diff --git a/ifpps.c b/ifpps.c index 1cdd9b1..ff9eaad 100644 --- a/ifpps.c +++ b/ifpps.c @@ -1298,15 +1298,12 @@ static int term_main(const char *ifname, uint64_t ms_interval, bool suppress_warnings __maybe_unused, bool omit_header) { - int first = 1; - do { stats_sample_generic(ifname, ms_interval); - if (first) { - first = 0; - if (!omit_header) - term_csv_header(ifname, &stats_new, ms_interval); + if (!omit_header) { + omit_header = true; + term_csv_header(ifname, &stats_new, ms_interval); } term_csv(&stats_delta, &stats_new); -- cgit v1.2.3-54-g00ecf