]> git.gsnw.org Git - fping.git/commitdiff
fix interval reporting
authorDavid Schweikert <david@schweikert.ch>
Wed, 2 Nov 2016 07:17:07 +0000 (08:17 +0100)
committerDavid Schweikert <david@schweikert.ch>
Wed, 2 Nov 2016 07:17:07 +0000 (08:17 +0100)
src/fping.c

index cc5d7159aa30e077be3986c93fc8dcef041a9e6f..cb45f0a406d01711ea2a36499ffad7b997873bda 100644 (file)
@@ -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 ( &current_time, &next_report_time );
+               wait_time_next_report = timeval_diff ( &next_report_time, &current_time );
                if(wait_time_next_report < wait_time) {
                     wait_time = wait_time_next_report;
                     if(wait_time < 0) { wait_time = 0; }