diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2013-10-02 08:19:23 +0200 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2013-10-02 08:19:23 +0200 |
commit | 8665a86cc2713b9ca8ae036435e61876fc513177 (patch) | |
tree | 120057bebcb671be50c0af86aea43525961b503a /ifpps.c | |
parent | d94e3725ecb2282d802e1241df4e491cc7da6720 (diff) |
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 <tklauser@distanz.ch>
Diffstat (limited to 'ifpps.c')
-rw-r--r-- | ifpps.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -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); |