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

Dmitry V. Levin ldv at altlinux.org
Sun Jul 26 19:23:27 UTC 2020


On Sun, Jul 26, 2020 at 09:19:44PM +0200, Ákos Uzonyi wrote:
> 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)"?

Yes, given that we are not going to use it in complex expressions.


-- 
ldv


More information about the Strace-devel mailing list