summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-06-20 15:29:00 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-06-24 13:20:10 +0300
commit012d9d840090892b2ac3bbc277585579a0b64079 (patch)
treee595aa3da2c0061fac9f07dda76f7ef681fae5f4 /runner
parent895986f591e56dd0215a2759a5cdc2fdac5ba783 (diff)
runner/executor: Make sure that intervals_left is always initialized
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@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'runner')
-rw-r--r--runner/executor.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/runner/executor.c b/runner/executor.c
index 39dee8c0..7a7e29d9 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -507,7 +507,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) {
@@ -518,6 +517,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 };