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

Petr Vorel pvorel@suse.cz
Mon Oct 2 17:04:17 CEST 2017


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


More information about the ltp mailing list