summaryrefslogtreecommitdiffstats
path: root/meta/recipes-rt
diff options
context:
space:
mode:
authorAndré Draszik <git@andred.net>2020-02-03 17:28:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-02-04 15:56:29 +0000
commit3bfe8cad8364ac89dfaf9bacad4a318f70ab19cc (patch)
treeb14c860fe87b881db6d8c87a3bd21385e226a507 /meta/recipes-rt
parente4893d48300ea6a3e172e046f83f3d4c54e95786 (diff)
downloadpoky-3bfe8cad8364ac89dfaf9bacad4a318f70ab19cc.tar.gz
rt-tests: modernise subprocess: preexec_fn=os.setsid -> start_new_session=True
start_new_session was added to python3 subprocess in v3.2 and is meant to take the place of the common use of preexec_fn to call os.setsid() in the child - as done here. Update to use the new equivalent. (From OE-Core rev: 0ebb56ff192e9c6db2af83c37db3307a27fe822a) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-rt')
-rwxr-xr-xmeta/recipes-rt/rt-tests/files/rt_bmark.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/recipes-rt/rt-tests/files/rt_bmark.py b/meta/recipes-rt/rt-tests/files/rt_bmark.py
index 57b39b52a1..3b84447a0f 100755
--- a/meta/recipes-rt/rt-tests/files/rt_bmark.py
+++ b/meta/recipes-rt/rt-tests/files/rt_bmark.py
@@ -166,12 +166,12 @@ def start_stress(*args):
166 log(" Command: '", stress_cmd_str, "'") 166 log(" Command: '", stress_cmd_str, "'")
167 log() 167 log()
168 168
169 # preexec_fn=os.setsid causes stress to be executed in a separate 169 # start_new_session causes stress to be executed in a separate
170 # session, => it gets a new process group (incl. children). It 170 # session, => it gets a new process group (incl. children). It
171 # can then be terminated using os.killpg in end_stress without 171 # can then be terminated using os.killpg in end_stress without
172 # terminating this script. 172 # terminating this script.
173 173
174 p = subprocess.Popen(stress_cmd, preexec_fn=os.setsid) 174 p = subprocess.Popen(stress_cmd, start_new_session=True)
175 175
176 return p 176 return p
177 177