From: David Schweikert Date: Wed, 2 Nov 2016 07:17:07 +0000 (+0100) Subject: fix interval reporting X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36f0b766450e1995af1453957ee8ad3d67566667;p=fping.git fix interval reporting --- diff --git a/src/fping.c b/src/fping.c index cc5d715..cb45f0a 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1098,7 +1098,7 @@ void main_loop() /* Make sure we don't wait too long, in case a report is expected */ if( report_interval && ( loop_flag || count_flag ) ) { - wait_time_next_report = timeval_diff ( ¤t_time, &next_report_time ); + wait_time_next_report = timeval_diff ( &next_report_time, ¤t_time ); if(wait_time_next_report < wait_time) { wait_time = wait_time_next_report; if(wait_time < 0) { wait_time = 0; }