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-14 22:49:22 +0000
commit75dde71fba75aaa40b26a0af818aa2db091a1cde (patch)
treeb43e82c0d4b07c45581fc1a8816c02f22f0f041f /scripts
parent9bb220ccc13a9d7dfb471ba7d49d0b7042f04306 (diff)
downloadpoky-75dde71fba75aaa40b26a0af818aa2db091a1cde.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: 7f95eb486a2d07cf0c821d5301fd670de34fe2d1) 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: Steve Sakoman <steve@sakoman.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 10880ba6bb..51607f10e5 100755
--- a/scripts/runqemu
+++ b/scripts/runqemu
@@ -1516,7 +1516,8 @@ def main():
1516 1516
1517 def sigterm_handler(signum, frame): 1517 def sigterm_handler(signum, frame):
1518 logger.info("SIGTERM received") 1518 logger.info("SIGTERM received")
1519 os.kill(config.qemupid, signal.SIGTERM) 1519 if config.qemupid:
1520 os.kill(config.qemupid, signal.SIGTERM)
1520 config.cleanup() 1521 config.cleanup()
1521 # Deliberately ignore the return code of 'tput smam'. 1522 # Deliberately ignore the return code of 'tput smam'.
1522 subprocess.call(["tput", "smam"]) 1523 subprocess.call(["tput", "smam"])