[LTP] [PATCH 3/3] netstress.c: convert to new library API

Cyril Hrubis chrubis@suse.cz
Mon Jan 30 14:13:43 CET 2017


Hi!
> >>   	shutdown(*fd, SHUT_WR);
> >> -	SAFE_CLOSE(cleanup, *fd);
> >> +	SAFE_CLOSE(*fd);
> >>   	*fd = -1;
> > FYI the SAFE_CLOSE() already sets fd to -1.
> 
> Ah, it's not, 'fd' passed by value there... I've blindly removed it
> from code but now I need to return it back.

Are you sure? SAFE_CLOSE() is a macro which expands to:

	do {
		safe_close("foo", 42, NULL, (*fd));
		(*fd) = -1;
	} while (0)

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list