From 4fc56c5cbea1725ba423dd3b173c09109c154c43 Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Fri, 24 May 2019 08:37:19 +0200 Subject: [PATCH] MPT driver incorrectly reporting a waitpid error The multi-process test driver program waits until all its children have stopped (or timeout) by calling ddsrt_proc_waitpids in a loop. The way the loop is written, it can try once more when all children have already been waited for, in which case it reports a spurious error. This fixes that problem by checking whether the error code was to be expected. Signed-off-by: Erik Boasson --- src/mpt/mpt/src/main.c.in | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mpt/mpt/src/main.c.in b/src/mpt/mpt/src/main.c.in index 14ca113..b48f3a6 100644 --- a/src/mpt/mpt/src/main.c.in +++ b/src/mpt/mpt/src/main.c.in @@ -355,8 +355,14 @@ mpt_run_test(const char *exe, mpt_suite_t *suite, mpt_test_t *test) result = EXIT_FAILURE; } } else if (retcode != DDS_RETCODE_NOT_FOUND) { - printf("Wait for processes of %s::%s failed (%d)\n", suite->name, test->name, (int)retcode); - result = EXIT_FAILURE; + for (proc = test->procs; proc; proc = proc->next) { + if (proc->pid != 0) + break; + } + if (proc != NULL) { + printf("Wait for processes of %s::%s failed (%d)\n", suite->name, test->name, (int)retcode); + result = EXIT_FAILURE; + } } }