[PATCH v3 7/7] Add tests for PID namespace translation

Ákos Uzonyi uzonyi.akos at gmail.com
Sun Jul 26 19:19:44 UTC 2020


On Sun, 26 Jul 2020 at 00:30, Dmitry V. Levin <ldv at altlinux.org> wrote:
> On Sat, Jul 25, 2020 at 01:12:43AM +0200, Ákos Uzonyi wrote:
> > @@ -360,6 +402,10 @@ create_sample(void)
> >  int
> >  main(void)
> >  {
> > +#ifdef PIDNS_TRANSLATION
> > +     pidns_test_init();
> > +#endif
> > +
>
> I suppose we could have a macro, e.g. PIDNS_TEST_INIT, defined this way:
>
> #ifdef PIDNS_TRANSLATION
> # define PIDNS_TEST_INIT pidns_test_init()
> #else
> # define PIDNS_TEST_INIT do {} while (0)
> #endif
>
> This would allow a more simple usage:
>
>         PIDNS_TEST_INIT;

Good idea, thanks.
Would it be OK to define PIDNS_TEST_INIT to be empty instead of "do {}
while (0)"?


More information about the Strace-devel mailing list