[LTP] [PATCH 1/1] syscalls, lib: Use SAFE_{BIND, LISTEN, SOCKET} macros

Petr Vorel
2017-10-02T15:04:17Z

Hi Richard,

> It is more advanced than the one I created to do something similar.

> > // SAFE_BIND
> > @old_safe_bind depends on test_h@
> > expression sockfd, sockaddr, addrlen;
> > identifier cleanup_fn;
> > expression e, x;
> > constant TFAIL;
> > @@
> > -if (bind(sockfd, sockaddr, addrlen) < 0) {
> > - tst_brkm(e, cleanup_fn, ...);
> > (
> > - return -1;

> > )
> > ... when != x & TFAIL

> What does the last line do? I am guessing it prevents the substitution
> if it finds TFAIL anywhere in the above expression.
Precisely :-).

Kind regards,
Petr