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

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Jan 28 10:44:59 UTC 2020


Chris Wilson <chris at chris-wilson.co.uk> writes:

> 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>

Reviewed-by: Mika Kuoppala <mika.kuoppala at linux.intel.com>

> ---
>  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
>
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev


More information about the igt-dev mailing list