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

Cyril Hrubis
2017-01-30T13:13:43Z

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