mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-10-29 05:40:16 -04:00
test-runner: wait for concrete pid
After running a test in fork, we were waiting for any child to terminate. It is OK unless the child forks again. If the child calls fork, the waitid can catch the child's child termination, stop block and run another test while the former test is still running. This is racy i. e. when adding socket. Since we have test compositor which uses fork, this situation can occur pretty frequently. Signed-off-by: Marek Chalupa <mchqwerty@gmail.com> Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
This commit is contained in:
parent
48bf640d16
commit
8094426a41
1 changed files with 1 additions and 1 deletions
|
|
@ -351,7 +351,7 @@ int main(int argc, char *argv[])
|
|||
if (pid == 0)
|
||||
run_test(t); /* never returns */
|
||||
|
||||
if (waitid(P_ALL, 0, &info, WEXITED)) {
|
||||
if (waitid(P_PID, pid, &info, WEXITED)) {
|
||||
stderr_set_color(RED);
|
||||
fprintf(stderr, "waitid failed: %m\n");
|
||||
stderr_reset_color();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue