summaryrefslogtreecommitdiffstats
path: root/scripts/runqemu
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-09 10:33:25 +0000
commit67700e174df8651910649d9cfd2ac2d6ad45c0a2 (patch)
tree598b7400b48e136dbea0e3eb62cf6f3b4f1c1af5 /scripts/runqemu
parent8e8a7add6c3476257719d2ee634256b438cc5c82 (diff)
downloadpoky-67700e174df8651910649d9cfd2ac2d6ad45c0a2.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: 0f3afbd3a6a6bef668612f818517df7543c0a683) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/runqemu')
-rwxr-xr-xscripts/runqemu3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/runqemu b/scripts/runqemu
index efb98ab9e0..410d2a9939 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1593,7 +1593,8 @@ def main():
1593 1593
1594 def sigterm_handler(signum, frame): 1594 def sigterm_handler(signum, frame):
1595 logger.info("SIGTERM received") 1595 logger.info("SIGTERM received")
1596 os.kill(config.qemupid, signal.SIGTERM) 1596 if config.qemupid:
1597 os.kill(config.qemupid, signal.SIGTERM)
1597 config.cleanup() 1598 config.cleanup()
1598 # Deliberately ignore the return code of 'tput smam'. 1599 # Deliberately ignore the return code of 'tput smam'.
1599 subprocess.call(["tput", "smam"]) 1600 subprocess.call(["tput", "smam"])