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

Knop, Ryszard ryszard.knop at intel.com
Thu Jun 30 13:41:10 UTC 2022


On Wed, 2022-06-29 at 18:28 +0200, Mauro Carvalho Chehab wrote:
> 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.

Will do for v2.

Thanks, Ryszard

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