[i-g-t,v2,3/4] runner/executor: Fix error handling at terminating test

Ryszard Knop rk at dragonic.eu
Wed Nov 27 14:32:49 UTC 2024


LGTM

Reviewed-by: Ryszard Knop <rk at dragonic.eu>

On Wed, 2024-11-20 at 19:32 +0100, Kamil Konieczny wrote:
> Instead of just returning and leaking memory and file descriptors
> inform user about an error which occurred and terminate
> gracefully.
> 
> Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> ---
>  runner/executor.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index a5b5c0eab..5a4c2e1b2 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -1533,8 +1533,12 @@ static int monitor_output(pid_t child,
>  			}
>  
>  			killed = next_kill_signal(killed);
> -			if (!kill_child(killed, child))
> -				return -1;
> +			if (!kill_child(killed, child)) {
> +				errf("Error at terminating test with %s, errno=%d\n",
> +				     killed == SIGQUIT ? "SIGQUIT" : "SIGKILL", errno);
> +				killed = -1;
> +				break; /* while */
> +			}
>  			time_killed = time_now;
>  		}
>  	}



More information about the igt-dev mailing list