summaryrefslogtreecommitdiff
path: root/libc/getent/pwent.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/getent/pwent.c')
-rw-r--r--libc/getent/pwent.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libc/getent/pwent.c b/libc/getent/pwent.c
index fd65db2..738c87a 100644
--- a/libc/getent/pwent.c
+++ b/libc/getent/pwent.c
@@ -53,6 +53,8 @@ endpwent(void)
struct passwd *
getpwent(void)
{
+ if (pw_fd==-1)
+ setpwent();
if (pw_fd!=-1)
return __getpwent(pw_fd);
return NULL;