[oe-commits] [openembedded-core] 02/02: ptest-runner: use process groups when spawning
git at git.openembedded.org
git at git.openembedded.org
Thu Apr 4 12:21:32 UTC 2019
This is an automated email from the git hooks/post-receive script.
rpurdie pushed a commit to branch warrior-next
in repository openembedded-core.
commit f4d6c6d5c3f6dafd02d9a72e199e4a5921f8aa5b
Author: Ross Burton <ross.burton at intel.com>
AuthorDate: Thu Apr 4 12:50:41 2019 +0100
ptest-runner: use process groups when spawning
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
.../ptest-runner/ptest-runner/setsid.patch | 48 ++++++++++++++++++++++
.../ptest-runner/ptest-runner_2.3.1.bb | 3 +-
2 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/meta/recipes-support/ptest-runner/ptest-runner/setsid.patch b/meta/recipes-support/ptest-runner/ptest-runner/setsid.patch
new file mode 100644
index 0000000..8a6f523
--- /dev/null
+++ b/meta/recipes-support/ptest-runner/ptest-runner/setsid.patch
@@ -0,0 +1,48 @@
+diff --git a/utils.c b/utils.c
+index 504df0b..bdee752 100644
+--- a/utils.c
++++ b/utils.c
+@@ -258,7 +258,7 @@ run_child(char *run_ptest, int fd_stdout, int fd_stderr)
+ }
+
+ static inline int
+-wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid,
++wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid, pid_t group,
+ int timeout, int *fds, FILE **fps, int *timeouted)
+ {
+ struct pollfd pfds[2];
+@@ -306,7 +306,7 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid,
+ clock_gettime(clock, &time);
+ if ((time.tv_sec - sentinel.tv_sec) > timeout) {
+ *timeouted = 1;
+- kill(pid, SIGKILL);
++ kill(-group, SIGKILL);
+ waitflags = 0;
+ }
+ }
+@@ -329,7 +329,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ struct ptest_list *p;
+ char stime[GET_STIME_BUF_SIZE];
+
+- pid_t child;
++ pid_t child, group;
+ int pipefd_stdout[2];
+ int pipefd_stderr[2];
+ int timeouted;
+@@ -368,6 +368,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ rc = -1;
+ break;
+ } else if (child == 0) {
++ group = setsid();
+ run_child(p->run_ptest, pipefd_stdout[1], pipefd_stderr[1]);
+ } else {
+ int status;
+@@ -378,7 +379,7 @@ run_ptests(struct ptest_list *head, const struct ptest_options opts,
+ fprintf(fp, "%s\n", get_stime(stime, GET_STIME_BUF_SIZE, sttime));
+ fprintf(fp, "BEGIN: %s\n", ptest_dir);
+
+- status = wait_child(ptest_dir, p->run_ptest, child,
++ status = wait_child(ptest_dir, p->run_ptest, child, group,
+ opts.timeout, fds, fps, &timeouted);
+ entime = time(NULL);
+ duration = entime - sttime;
diff --git a/meta/recipes-support/ptest-runner/ptest-runner_2.3.1.bb b/meta/recipes-support/ptest-runner/ptest-runner_2.3.1.bb
index 4b7992b..f91fb08 100644
--- a/meta/recipes-support/ptest-runner/ptest-runner_2.3.1.bb
+++ b/meta/recipes-support/ptest-runner/ptest-runner_2.3.1.bb
@@ -10,7 +10,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=751419260aa954499f7abaabaa882bbe"
SRCREV = "05b112bda7ac2adba8e9b0f088d6e5843b148a38"
PV = "2.3.1+git${SRCPV}"
-SRC_URI = "git://git.yoctoproject.org/ptest-runner2"
+SRC_URI = "git://git.yoctoproject.org/ptest-runner2 \
+ file://setsid.patch"
S = "${WORKDIR}/git"
FILES_${PN} = "${bindir}/ptest-runner"
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list