From 2e645a20cbef8049ee3a801d35df2fe7c20dc79f Mon Sep 17 00:00:00 2001 From: Steve Price Date: Sun, 1 Feb 1998 06:16:08 +0000 Subject: [PATCH] XOpen says the void setpwent(void) is correct. Also call setpassent(0) instead of duplicating code, albeit trivial (inspired by NetBSD). PR: 5524 --- include/pwd.h | 2 +- lib/libc/gen/getpwent.c | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/pwd.h b/include/pwd.h index 0cc41bb1d67..895ced304ef 100644 --- a/include/pwd.h +++ b/include/pwd.h @@ -103,7 +103,7 @@ struct passwd *getpwnam __P((const char *)); #ifndef _POSIX_SOURCE struct passwd *getpwent __P((void)); int setpassent __P((int)); -int setpwent __P((void)); +void setpwent __P((void)); void endpwent __P((void)); #endif __END_DECLS diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index dfe5d3437bd..1fc4fdd8c26 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -214,15 +214,10 @@ setpassent(stayopen) return(1); } -int +void setpwent() { - _pw_keynum = 0; -#ifdef YP - _pw_stepping_yp = 0; -#endif - _pw_stayopen = 0; - return(1); + (void)setpassent(0); } void