mirror of
https://github.com/coreutils/coreutils.git
synced 2025-01-21 15:43:30 +08:00
(getuser, getuidbyname, getgroup, getgidbyname): Likewise.
This commit is contained in:
parent
2639d24e52
commit
eb231be3d6
@ -66,7 +66,7 @@ getuser (uid_t uid)
|
||||
return tail->name;
|
||||
|
||||
pwent = getpwuid (uid);
|
||||
tail = xmalloc (sizeof (struct userid));
|
||||
tail = xmalloc (sizeof *tail);
|
||||
tail->id.u = uid;
|
||||
tail->name = pwent ? xstrdup (pwent->pw_name) : NULL;
|
||||
|
||||
@ -108,7 +108,7 @@ getuidbyname (const char *user)
|
||||
}
|
||||
#endif
|
||||
|
||||
tail = xmalloc (sizeof (struct userid));
|
||||
tail = xmalloc (sizeof *tail);
|
||||
tail->name = xstrdup (user);
|
||||
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
@ -142,7 +142,7 @@ getgroup (gid_t gid)
|
||||
return tail->name;
|
||||
|
||||
grent = getgrgid (gid);
|
||||
tail = xmalloc (sizeof (struct userid));
|
||||
tail = xmalloc (sizeof *tail);
|
||||
tail->id.g = gid;
|
||||
tail->name = grent ? xstrdup (grent->gr_name) : NULL;
|
||||
|
||||
@ -184,7 +184,7 @@ getgidbyname (const char *group)
|
||||
}
|
||||
#endif
|
||||
|
||||
tail = xmalloc (sizeof (struct userid));
|
||||
tail = xmalloc (sizeof *tail);
|
||||
tail->name = xstrdup (group);
|
||||
|
||||
/* Add to the head of the list, so most recently used is first. */
|
||||
|
Loading…
Reference in New Issue
Block a user