Don't call setgrent() in an unportable way.

For FreeBSD 12, I'm considering updating setgrent() to have a function
prototype that conforms to POSIX. FreeBSD seems to be the only operating
system that lets setgrent() return an integer. It's also inconsistent
with setpwent().

It looks like our libcasper depends on setgrent() returning an integer.
Get rid of that.

Reviewed by:	oshogbo
Differential Revision:	https://reviews.freebsd.org/D6659
This commit is contained in:
Ed Schouten 2016-06-01 20:45:21 +00:00
parent ea580d0b45
commit 2ca9ffa9bb

View file

@ -703,7 +703,9 @@ grp_setgrent(const nvlist_t *limits __unused, const nvlist_t *nvlin __unused,
nvlist_t *nvlout __unused)
{
return (setgrent() == 0 ? EFAULT : 0);
setgrent();
return (0);
}
static int