From fff9c70e33036a80875dc25d359ef22c2c0a524c Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Fri, 31 Oct 2003 20:17:01 +0000 Subject: getpwent(), getpwent_r(), and getgrent(), getgrent_r() would all fail if you had not previously called setpwent() or setgrent() respectively. Oops. My bad. -Erik --- libc/pwd_grp/pwent.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/pwd_grp/pwent.c') diff --git a/libc/pwd_grp/pwent.c b/libc/pwd_grp/pwent.c index e3488f4f5..b2c149b35 100644 --- a/libc/pwd_grp/pwent.c +++ b/libc/pwd_grp/pwent.c @@ -72,7 +72,8 @@ int getpwent_r (struct passwd *password, char *buff, int ret=EINVAL; LOCK; *result = NULL; - if (pw_fd != -1 && (ret=__getpwent_r(password, buff, buflen, pw_fd)) == 0) { + + if ((ret=__getpwent_r(password, buff, buflen, pw_fd)) == 0) { UNLOCK; *result = password; return 0; -- cgit v1.2.3