diff --git a/include/grp.h b/include/grp.h index b10fd0f8ad36..8103808cca11 100644 --- a/include/grp.h +++ b/include/grp.h @@ -75,8 +75,7 @@ int pwcache_groupdb(int (*)(int), void (*)(void), struct group * (*)(gid_t)); #endif #if __XSI_VISIBLE -/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ -int setgrent(void); +void setgrent(void); #endif #if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE int getgrgid_r(gid_t, struct group *, char *, size_t, diff --git a/lib/libc/gen/getgrent.3 b/lib/libc/gen/getgrent.3 index da2ed8ccbcbd..18a52da6e520 100644 --- a/lib/libc/gen/getgrent.3 +++ b/lib/libc/gen/getgrent.3 @@ -28,7 +28,7 @@ .\" From: @(#)getgrent.3 8.2 (Berkeley) 4/19/94 .\" $FreeBSD$ .\" -.Dd April 16, 2003 +.Dd July 31, 2016 .Dt GETGRENT 3 .Os .Sh NAME @@ -60,7 +60,7 @@ .Fn getgrgid_r "gid_t gid" "struct group *grp" "char *buffer" "size_t bufsize" "struct group **result" .Ft int .Fn setgroupent "int stayopen" -.Ft int +.Ft void .Fn setgrent void .Ft void .Fn endgrent void @@ -188,14 +188,13 @@ is set to .Dv NULL and the return value is 0, no matching entry exists.) .Pp -The functions +The function .Fn setgroupent -and -.Fn setgrent -return the value 1 if successful, otherwise the value +returns the value 1 if successful, otherwise the value 0 is returned. The functions -.Fn endgrent +.Fn endgrent , +.Fn setgrent and .Fn setgrfile have no return value. diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index 2179fb27d0c0..dca5375faea4 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -533,12 +533,10 @@ out: return (rv); } -/* XXX IEEE Std 1003.1, 2003 specifies `void setgrent(void)' */ -int +void setgrent(void) { (void)_nsdispatch(NULL, setgrent_dtab, NSDB_GROUP, "setgrent", defaultsrc, 0); - return (1); } diff --git a/usr.sbin/pw/pw_vpw.c b/usr.sbin/pw/pw_vpw.c index 84301134c268..58e52946f146 100644 --- a/usr.sbin/pw/pw_vpw.c +++ b/usr.sbin/pw/pw_vpw.c @@ -130,13 +130,10 @@ vendgrent(void) } } -RET_SETGRENT +void vsetgrent(void) { vendgrent(); -#if defined(__FreeBSD__) - return 0; -#endif } static struct group * diff --git a/usr.sbin/pw/pwupd.h b/usr.sbin/pw/pwupd.h index 7fecffb7da4b..daca487835f1 100644 --- a/usr.sbin/pw/pwupd.h +++ b/usr.sbin/pw/pwupd.h @@ -38,12 +38,6 @@ #include #include -#if defined(__FreeBSD__) -#define RET_SETGRENT int -#else -#define RET_SETGRENT void -#endif - struct pwf { int _altdir; void (*_setpwent)(void); @@ -51,7 +45,7 @@ struct pwf { struct passwd * (*_getpwent)(void); struct passwd * (*_getpwuid)(uid_t uid); struct passwd * (*_getpwnam)(const char * nam); - RET_SETGRENT (*_setgrent)(void); + void (*_setgrent)(void); void (*_endgrent)(void); struct group * (*_getgrent)(void); struct group * (*_getgrgid)(gid_t gid); @@ -141,7 +135,7 @@ struct passwd * vgetpwnam(const char * nam); struct group * vgetgrent(void); struct group * vgetgrgid(gid_t gid); struct group * vgetgrnam(const char * nam); -RET_SETGRENT vsetgrent(void); +void vsetgrent(void); void vendgrent(void); void copymkdir(int rootfd, char const * dir, int skelfd, mode_t mode, uid_t uid,