[LTP] [PATCH 1/1] syscalls: Add missing WEXITSTATUS() check

Petr Vorel pvorel@suse.cz
Tue Nov 12 18:05:34 CET 2024


Hi Cyril,

...
> > > --- a/testcases/kernel/syscalls/madvise/madvise08.c
> > > +++ b/testcases/kernel/syscalls/madvise/madvise08.c
> > > @@ -165,7 +165,7 @@ static pid_t run_child(int advice)
> > >                                 fmem,
> > >                                 FMEMSIZE,
> > >                                 advstr);
> > > -                       exit(1);
> > > +                       exit(0);
> > >                 }
> > >                 abort();
> > >         }

> > Good catch, thanks!

> > Maybe it'd be more logical to keep exit(1) (it's error) and check against
> > WEXITSTATUS(status) == 1, but it's a minor detail, let's keep exit(0).

> I wouldn't do so, as it may confuse people into thinking that the return
> value actually carries any information, which it does not since the
> failure has been already reported. I would just stick to exit(0) which
> makes it more clear that we just need to exit the process, nothing more.

This makes sense, kept it this way.

> > Can I merge with your RBT?

> Yes, with the fix above.

Thanks, merged.

Kind regards,
Petr


More information about the ltp mailing list