[igt-dev] [PATCH i-g-t 6/7] runner: Set requested env vars during execution

Mauro Carvalho Chehab mauro.chehab at linux.intel.com
Wed Jun 29 16:28:14 UTC 2022


On Tue, 28 Jun 2022 11:44:34 +0200
Ryszard Knop <ryszard.knop at intel.com> wrote:

> Signed-off-by: Ryszard Knop <ryszard.knop at intel.com>
> ---
>  runner/executor.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/runner/executor.c b/runner/executor.c
> index 9b89cc09..21c41715 100644
> --- a/runner/executor.c
> +++ b/runner/executor.c
> @@ -1872,6 +1872,14 @@ bool execute(struct execute_state *state,
>  		return true;
>  	}
>  
> +	if (!igt_list_empty_or_null(&settings->env_vars)) {

Just always initialize the list. This would avoid tests like this.

> +		struct environment_variable *iter;
> +
> +		igt_list_for_each_entry(iter, &settings->env_vars, link) {
> +			setenv(iter->key, iter->value, 1);
> +		}
> +	}
> +

The rest looks ok on my eyes.

>  	if ((resdirfd = open(settings->results_path, O_DIRECTORY | O_RDONLY)) < 0) {
>  		/* Initialize state should have done this */
>  		errf("Error: Failure opening results path %s\n",


More information about the igt-dev mailing list