Skip to content
Permalink
Browse files

sanitycheck: handle pid file not being present

Do not try to open non-existing pid files.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
  • Loading branch information...
nashif committed Apr 11, 2019
1 parent 042d9b7 commit d6476eee3ee01fa1114219bb8d43664e98f9460f
Showing with 9 additions and 7 deletions.
  1. +9 −7 scripts/sanitycheck
@@ -808,14 +808,16 @@ class QEMUHandler(Handler):
log_out_fp.close()
out_fp.close()
in_fp.close()
if os.path.exists(pid_fn):
pid = int(open(pid_fn).read())
os.unlink(pid_fn)

pid = int(open(pid_fn).read())
os.unlink(pid_fn)
try:
os.kill(pid, signal.SIGTERM)
except ProcessLookupError:
# Oh well, as long as it's dead! User probably sent Ctrl-C
pass
try:
if pid:
os.kill(pid, signal.SIGTERM)
except ProcessLookupError:
# Oh well, as long as it's dead! User probably sent Ctrl-C
pass

os.unlink(fifo_in)
os.unlink(fifo_out)

0 comments on commit d6476ee

Please sign in to comment.
You can’t perform that action at this time.