summaryrefslogtreecommitdiff
path: root/runner
diff options
context:
space:
mode:
authorPetri Latvala <petri.latvala@intel.com>2021-02-08 12:24:39 +0200
committerPetri Latvala <petri.latvala@intel.com>2021-02-09 07:57:07 +0200
commit2982c998a9cb79095611fba018d5df3eec5eab88 (patch)
tree2861ea03f94ceb208bf080d9e342aa4c879b2c20 /runner
parentb0160aad9e547d2205341e0b6783e12aa143566e (diff)
runner: Handle graceful exit regardless of log level
The SIGHUP handling was incorrectly done only when log level was at least 'normal'. Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arek@hiler.eu> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'runner')
-rw-r--r--runner/executor.c52
1 files changed, 24 insertions, 28 deletions
diff --git a/runner/executor.c b/runner/executor.c
index 3ca2d20a..9b582179 100644
--- a/runner/executor.c
+++ b/runner/executor.c
@@ -1008,37 +1008,33 @@ static int monitor_output(pid_t child,
get_cmdline(siginfo.ssi_pid, comm, sizeof(comm)),
siginfo.ssi_pid,
strsignal(siginfo.ssi_signo));
+ }
- if (siginfo.ssi_signo == SIGHUP) {
- /*
- * If taken down with
- * SIGHUP, arrange the
- * current test to be
- * marked as notrun
- * instead of
- * incomplete. For
- * other signals we
- * don't need to do
- * anything, the lack
- * of a completion
- * marker of any kind
- * in the logs will
- * mark those tests as
- * incomplete. Note
- * that since we set
- * 'aborting' to true
- * we're going to skip
- * all other journal
- * writes later.
- */
+ if (siginfo.ssi_signo == SIGHUP) {
+ /*
+ * If taken down with SIGHUP,
+ * arrange the current test to
+ * be marked as notrun instead
+ * of incomplete. For other
+ * signals we don't need to do
+ * anything, the lack of a
+ * completion marker of any
+ * kind in the logs will mark
+ * those tests as
+ * incomplete. Note that since
+ * we set 'aborting' to true
+ * we're going to skip all
+ * other journal writes later.
+ */
+ if (settings->log_level >= LOG_LEVEL_NORMAL)
outf("Exiting gracefully, currently running test will have a 'notrun' result\n");
- dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
- EXECUTOR_EXIT,
- -SIGHUP, 0.0);
- if (settings->sync)
- fdatasync(outputs[_F_JOURNAL]);
- }
+
+ dprintf(outputs[_F_JOURNAL], "%s%d (%.3fs)\n",
+ EXECUTOR_EXIT,
+ -SIGHUP, 0.0);
+ if (settings->sync)
+ fdatasync(outputs[_F_JOURNAL]);
}
aborting = true;