mirror of
https://git.yoctoproject.org/meta-arm
synced 2026-04-20 11:29:54 +00:00
runfvp: ignore setpgid errors when spawned
When runfvp is spawned from an other process (for example except), it is throwing a permission error. To solve the problem, surround the call to setpgid with a try/except and ignore the permission errors. Signed-off-by: Bertrand Marquis <bertrand.marquis@arm.com> Signed-off-by: Jon Mason <jon.mason@arm.com>
This commit is contained in:
committed by
Jon Mason
parent
8a0a9c3d32
commit
a25192f51d
@@ -270,7 +270,12 @@ if __name__ == "__main__":
|
||||
try:
|
||||
# Set the process group so that it's possible to kill runfvp and
|
||||
# everything it spawns easily.
|
||||
os.setpgid(0, 0)
|
||||
# Ignore permission errors happening when spawned from an other process
|
||||
# for example run from except
|
||||
try:
|
||||
os.setpgid(0, 0)
|
||||
except PermissionError:
|
||||
pass
|
||||
if sys.stdin.isatty():
|
||||
signal.signal(signal.SIGTTOU, signal.SIG_IGN)
|
||||
os.tcsetpgrp(sys.stdin.fileno(), os.getpgrp())
|
||||
|
||||
Reference in New Issue
Block a user