diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-06-12 23:27:00 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-06-12 23:27:00 +0000 |
commit | c617db9065afa51100199d9ac4561feee4279291 (patch) | |
tree | e4a90725f73b9fb7ec9970ca495172181acfa873 /libc/pwd_grp/fgetpwent.c | |
parent | fd6b9378be20243eaea7da1c2ddb3d68f123d28e (diff) |
Silence warnings, clean things up.
-Erik
Diffstat (limited to 'libc/pwd_grp/fgetpwent.c')
-rw-r--r-- | libc/pwd_grp/fgetpwent.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libc/pwd_grp/fgetpwent.c b/libc/pwd_grp/fgetpwent.c index ae43cdad8..e025cf6cc 100644 --- a/libc/pwd_grp/fgetpwent.c +++ b/libc/pwd_grp/fgetpwent.c @@ -20,28 +20,24 @@ #include <errno.h> #include <stdio.h> -#include <pwd.h> #include "config.h" -#define PWD_BUFFER_SIZE 256 - -/* file descriptor for the password file currently open */ -static char line_buff[PWD_BUFFER_SIZE]; -static struct passwd pwd; - int fgetpwent_r (FILE *file, struct passwd *password, char *buff, size_t buflen, struct passwd **crap) { - if (file == NULL) { - __set_errno(EINTR); - return -1; - } - return(__getpwent_r(password, buff, buflen, fileno(file))); + if (file == NULL) { + __set_errno(EINTR); + return -1; + } + return(__getpwent_r(password, buff, buflen, fileno(file))); } struct passwd *fgetpwent(FILE * file) { - if (fgetpwent_r(file, &pwd, line_buff, PWD_BUFFER_SIZE, NULL) != -1) { + static char line_buff[PWD_BUFFER_SIZE]; + static struct passwd pwd; + + if (fgetpwent_r(file, &pwd, line_buff, sizeof(line_buff), NULL) != -1) { return &pwd; } return NULL; |