[igt-dev] [PATCH i-g-t 1/3] runner/executor: Make sure that intervals_left is always initialized

Arkadiusz Hiler arkadiusz.hiler at intel.com
Thu Jun 20 12:29:00 UTC 2019


intervals_left got initialized only when when we had a timeout exceeding
watchdog capabilities, meaning we had to use multiple shorter intervals

by moving intervals_left = timeout_intervals down we are always
initializing it

Cc: Petri Latvala <petri.latvala at intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler at intel.com>
---
 runner/executor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/runner/executor.c b/runner/executor.c
index 7e5fbe8f..bce4d420 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -493,7 +493,6 @@ static int monitor_output(pid_t child,
 			if (wd_timeout - wd_extra < 0)
 				wd_extra = wd_timeout / 2;
 			timeout_intervals = timeout / (wd_timeout - wd_extra);
-			intervals_left = timeout_intervals;
 			timeout /= timeout_intervals;
 
 			if (settings->log_level >= LOG_LEVEL_VERBOSE) {
@@ -504,6 +503,8 @@ static int monitor_output(pid_t child,
 		}
 	}
 
+	intervals_left = timeout_intervals;
+
 	while (outfd >= 0 || errfd >= 0 || sigfd >= 0) {
 		struct timeval tv = { .tv_sec = timeout };
 
-- 
2.21.0



More information about the igt-dev mailing list