[igt-dev] [PATCH i-g-t] lib: Report wait() failures

Chris Wilson chris at chris-wilson.co.uk
Mon Jan 27 16:14:39 UTC 2020


Check the error status from a wait() failure and propagate if not SIGINT
-- to avoid falling into a trap of an infinite error loop.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/igt_core.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/lib/igt_core.c b/lib/igt_core.c
index 0a0068946..72d55d5c2 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -2174,8 +2174,14 @@ int __igt_waitchildren(void)
 		int c;
 
 		pid = wait(&status);
-		if (pid == -1)
-			continue;
+		if (pid == -1) {
+			if (errno == EINTR)
+				continue;
+
+			printf("wait(num_children:%d) failed with %m\n",
+			       num_test_children - count);
+			return IGT_EXIT_FAILURE;
+		}
 
 		for (c = 0; c < num_test_children; c++)
 			if (pid == test_children[c])
-- 
2.25.0



More information about the igt-dev mailing list