diff options
author | Ross Burton <ross@burtonini.com> | 2021-12-08 17:02:30 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-12-09 10:33:21 +0000 |
commit | 0f3afbd3a6a6bef668612f818517df7543c0a683 (patch) | |
tree | 2031784100ad55796f3d21c900332c6d673e4656 /scripts | |
parent | 1af0c4ef56d1892f284b6787ccc5a925d023e178 (diff) | |
download | openembedded-core-contrib-0f3afbd3a6a6bef668612f818517df7543c0a683.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 ]
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/runqemu | 3 |
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(): def sigterm_handler(signum, frame): logger.info("SIGTERM received") - os.kill(config.qemupid, signal.SIGTERM) + if config.qemupid: + os.kill(config.qemupid, signal.SIGTERM) config.cleanup() # Deliberately ignore the return code of 'tput smam'. subprocess.call(["tput", "smam"]) |