From 9a80a352a9d0c4ea09de7bb370267672c32771f2 Mon Sep 17 00:00:00 2001 From: Randy MacLeod Date: Thu, 1 Aug 2019 16:36:48 -0400 Subject: ptest-runner: update from 2.3.1 to 2.3.2 All local patches are now upstream so they have been dropped. Other upstream commits make ptest-runner build using: clang -Weverything $ git log --oneline b73bd54..7015e91 7015e91 (HEAD -> oe-core-master, tag: v2.3.2, origin/master, origin/HEAD, master) Fix additional warnings when using clang dd1daa8 tests: fix clang warnings. 15fd131 main code: fix clang warnings 59381a6 utils: ensure child can be session leader 5fe2c0a utils: Ensure pipes are read after exit 79a9c27 use process groups when spawning b73bd54 utils: Ensure stdout/stderr are flushed Signed-off-by: Randy MacLeod Signed-off-by: Richard Purdie --- ...03-utils-Ensure-pipes-are-read-after-exit.patch | 76 ---------------------- 1 file changed, 76 deletions(-) delete mode 100644 meta/recipes-support/ptest-runner/ptest-runner/0003-utils-Ensure-pipes-are-read-after-exit.patch (limited to 'meta/recipes-support/ptest-runner/ptest-runner/0003-utils-Ensure-pipes-are-read-after-exit.patch') diff --git a/meta/recipes-support/ptest-runner/ptest-runner/0003-utils-Ensure-pipes-are-read-after-exit.patch b/meta/recipes-support/ptest-runner/ptest-runner/0003-utils-Ensure-pipes-are-read-after-exit.patch deleted file mode 100644 index f7c3ebe6f2..0000000000 --- a/meta/recipes-support/ptest-runner/ptest-runner/0003-utils-Ensure-pipes-are-read-after-exit.patch +++ /dev/null @@ -1,76 +0,0 @@ -From e58e4e1a7f854953f823dc5135d35f728f253f31 Mon Sep 17 00:00:00 2001 -From: Richard Purdie -Date: Thu, 4 Apr 2019 14:24:14 +0100 -Subject: [PATCH 3/3] utils: Ensure pipes are read after exit - -There was a race in the code where the pipes may not be read after the process has exited -and data may be left behind in them. This change to ordering ensures the pipes are read -after the exit code has been read meaning no data can be left behind and the logs should -be complete. - -Signed-off-by: Richard Purdie -Upstream-Status: Pending [code being tested] ---- - utils.c | 29 ++++++++++++++++------------- - 1 file changed, 16 insertions(+), 13 deletions(-) - -diff --git a/utils.c b/utils.c -index c5b3b8d..37e88ab 100644 ---- a/utils.c -+++ b/utils.c -@@ -264,6 +264,7 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid, pid_t group, - struct pollfd pfds[2]; - struct timespec sentinel; - clockid_t clock = CLOCK_MONOTONIC; -+ int looping = 1; - int r; - - int status; -@@ -281,9 +282,23 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid, pid_t group, - - *timeouted = 0; - -- while (1) { -+ while (looping) { - waitflags = WNOHANG; - -+ if (timeout >= 0) { -+ struct timespec time; -+ -+ clock_gettime(clock, &time); -+ if ((time.tv_sec - sentinel.tv_sec) > timeout) { -+ *timeouted = 1; -+ kill(-pid, SIGKILL); -+ waitflags = 0; -+ } -+ } -+ -+ if (waitpid(pid, &status, waitflags) == pid) -+ looping = 0; -+ - r = poll(pfds, 2, WAIT_CHILD_POLL_TIMEOUT_MS); - if (r > 0) { - char buf[WAIT_CHILD_BUF_MAX_SIZE]; -@@ -303,19 +318,7 @@ wait_child(const char *ptest_dir, const char *run_ptest, pid_t pid, pid_t group, - } - - clock_gettime(clock, &sentinel); -- } else if (timeout >= 0) { -- struct timespec time; -- -- clock_gettime(clock, &time); -- if ((time.tv_sec - sentinel.tv_sec) > timeout) { -- *timeouted = 1; -- kill(-pid, SIGKILL); -- waitflags = 0; -- } - } -- -- if (waitpid(pid, &status, waitflags) == pid) -- break; - } - - fflush(fps[0]); --- -2.17.1 - -- cgit 1.2.3-korg