From 2f25e1ff8be8014b25175047b4f55ca7401eda2b Mon Sep 17 00:00:00 2001 From: "Costa Tsaousis (ktsaou)" Date: Wed, 2 Nov 2016 00:53:30 +0200 Subject: [PATCH] fix for 100% CPU time when -l -Q are given --- src/fping.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/fping.c b/src/fping.c index 205638a..acefc6a 100644 --- a/src/fping.c +++ b/src/fping.c @@ -1101,6 +1101,8 @@ 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 ); + if(wait_time_next_report < 0) + wait_time_next_report = -wait_time_next_report; if(wait_time_next_report < wait_time) { wait_time = wait_time_next_report; if(wait_time < 0) { wait_time = 0; } -- 2.43.0