summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2013-10-02 08:19:23 +0200
committerTobias Klauser <tklauser@distanz.ch>2013-10-02 08:19:23 +0200
commit8665a86cc2713b9ca8ae036435e61876fc513177 (patch)
tree120057bebcb671be50c0af86aea43525961b503a
parentd94e3725ecb2282d802e1241df4e491cc7da6720 (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>
-rw-r--r--ifpps.c9
1 files changed, 3 insertions, 6 deletions
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);