mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
Fri Aug 25 12:12:42 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* sysdeps/mach/hurd/mmap.c: Fix inverted test of MAP_FIXED. * stdio/vfscanf.c (number): Allow field width to inhibit first digit after base detection. * stdio/vfprintf.c (vfprintf: %s): Never search past the limit specified by the precision. * grp/grpread.c (__grpscan): New function. * grp/grp.h (__grpscan): Declare it. * grp/getgrgid.c: Use __grpscan. * grp/getgrnam.c: Likewise. * pwd/pwdread.c (__pwdscan): New function. * pwd/pwd.h (__pwdscan): Declare it. * pwd/getpwnam.c: Use __pwdscan. * pwd/getpwuid.c: Likewise. Thu Aug 24 16:29:40 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu> * sysdeps/mach/hurd/mmap.c: Treat (FLAGS & MAP_TYPE) == 0 like MAP_FILE. * hurd/thread-cancel.c: Return EINTR when called on self. * sysdeps/i386/elf/start.S (data_start): Define as weak alias for __data_start.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1991, 1995 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
@ -24,27 +24,13 @@ Cambridge, MA 02139, USA. */
|
||||
|
||||
/* Search for an entry with a matching uid. */
|
||||
struct passwd *
|
||||
DEFUN(getpwuid, (uid), register uid_t uid)
|
||||
DEFUN(getpwuid, (uid), uid_t uid)
|
||||
{
|
||||
static PTR info;
|
||||
register FILE *stream;
|
||||
register struct passwd *p;
|
||||
|
||||
if (info == NULL)
|
||||
int match (struct passwd *p)
|
||||
{
|
||||
info = __pwdalloc();
|
||||
if (info == NULL)
|
||||
return(NULL);
|
||||
return p->pw_uid == uid;
|
||||
}
|
||||
static void *info;
|
||||
|
||||
stream = __pwdopen();
|
||||
if (stream == NULL)
|
||||
return(NULL);
|
||||
|
||||
while ((p = __pwdread(stream, info)) != NULL)
|
||||
if (p->pw_uid == uid)
|
||||
break;
|
||||
|
||||
(void) fclose(stream);
|
||||
return(p);
|
||||
return __pwdscan (&info, &match);
|
||||
}
|
||||
|
Reference in New Issue
Block a user