summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-12-08 17:02:30 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-12-17 10:02:39 +0000
commitb498dc5a97fda7e451241c6d637ad082941427cf (patch)
tree581c71798206c6850e9bd9433b6f2fa6887889f0 /scripts
parentf996b0f31803aa0bf4bc5e103ff72eadf23cfd4d (diff)
downloadpoky-b498dc5a97fda7e451241c6d637ad082941427cf.tar.gz
runqemu: check the qemu PID has been set before kill()ing it
If runqemu is killed, check that we have a valid PID for the qemu before sending a kill() to it. [ YOCTO #14651 ] (From OE-Core rev: 48bd07808672fe84a452a5b0f4f4b6ff7daa32ae) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 0f3afbd3a6a6bef668612f818517df7543c0a683) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/runqemu3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index c467b0eb19..66e035c9af 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1580,7 +1580,8 @@ def main():
1580 1580
1581 def sigterm_handler(signum, frame): 1581 def sigterm_handler(signum, frame):
1582 logger.info("SIGTERM received") 1582 logger.info("SIGTERM received")
1583 os.kill(config.qemupid, signal.SIGTERM) 1583 if config.qemupid:
1584 os.kill(config.qemupid, signal.SIGTERM)
1584 config.cleanup() 1585 config.cleanup()
1585 # Deliberately ignore the return code of 'tput smam'. 1586 # Deliberately ignore the return code of 'tput smam'.
1586 subprocess.call(["tput", "smam"]) 1587 subprocess.call(["tput", "smam"])