diff options
Diffstat (limited to 'meta/recipes-support/ptest-runner/ptest-runner/0002-use-process-groups-when-spawning.patch')
-rw-r--r-- | meta/recipes-support/ptest-runner/ptest-runner/0002-use-process-groups-when-spawning.patch | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/meta/recipes-support/ptest-runner/ptest-runner/0002-use-process-groups-when-spawning.patch b/meta/recipes-support/ptest-runner/ptest-runner/0002-use-process-groups-when-spawning.patch new file mode 100644 index 0000000000..5436a3340c --- /dev/null +++ b/meta/recipes-support/ptest-runner/ptest-runner/0002-use-process-groups-when-spawning.patch | |||
@@ -0,0 +1,35 @@ | |||
1 | From f0c42a65633341ad048718c7a6dbd035818e9eaf Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
3 | Date: Thu, 4 Apr 2019 14:20:31 +0100 | ||
4 | Subject: [PATCH 2/3] use process groups when spawning | ||
5 | |||
6 | Rather than just killing the process we've swawned, set the process group | ||
7 | for spawned children and then kill the group of processes. | ||
8 | |||
9 | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> | ||
10 | Upstream-Status: Pending [code being tested] | ||
11 | --- | ||
12 | utils.c | 9 +++++---- | ||
13 | 1 file changed, 5 insertions(+), 4 deletions(-) | ||
14 | |||
15 | diff --git a/utils.c b/utils.c | ||
16 | index 3ceb342..c5b3b8d 100644 | ||
17 | --- a/utils.c | ||
18 | +++ b/utils.c | ||
19 | @@ -309,7 +309,7 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid, | ||
20 | clock_gettime(clock, &time); | ||
21 | if ((time.tv_sec - sentinel.tv_sec) > timeout) { | ||
22 | *timeouted = 1; | ||
23 | - kill(pid, SIGKILL); | ||
24 | + kill(-pid, SIGKILL); | ||
25 | waitflags = 0; | ||
26 | } | ||
27 | } | ||
28 | @@ -371,6 +371,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts, | ||
29 | rc = -1; | ||
30 | break; | ||
31 | } else if (child == 0) { | ||
32 | + setsid(); | ||
33 | run_child(p->run_ptest, pipefd_stdout[1], pipefd_stderr[1]); | ||
34 | } else { | ||
35 | int status; | ||