From 266eb16568dfccc4ff3395512f0b52cbcc7ea293 Mon Sep 17 00:00:00 2001 From: Erik Auerswald Date: Sat, 17 Feb 2024 17:34:57 +0100 Subject: [PATCH] use function stats_reset_interval() Git commit bb8d71ef27f673f25c7e1648ea982c27bb61ac0d from 2020 among many other things introduced the function stats_reset_interval() to reset the *_i interval (or split) host statistics, but did not use it. This commit replaces the open coded reset of interval stats inside print_host_splits() and print_netdata() with calling stats_reset_interval(). --- src/fping.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fping.c b/src/fping.c index 820eaef..be37565 100644 --- a/src/fping.c +++ b/src/fping.c @@ -380,6 +380,7 @@ void usage(int); int wait_for_reply(int64_t); void print_per_system_stats(void); void print_per_system_splits(void); +void stats_reset_interval(HOST_ENTRY *h); void print_netdata(void); void print_global_stats(void); void main_loop(); @@ -1738,7 +1739,7 @@ void print_netdata(void) } printf("END\n"); - h->num_sent_i = h->num_recv_i = h->max_reply_i = h->min_reply_i = h->total_time_i = 0; + stats_reset_interval(h); } sent_charts = 1; @@ -1798,7 +1799,7 @@ void print_per_system_splits(void) } fprintf(stderr, "\n"); - h->num_sent_i = h->num_recv_i = h->max_reply_i = h->min_reply_i = h->total_time_i = 0; + stats_reset_interval(h); } }