diff options
author | Eric Blake <ebb9@byu.net> | 2009-11-12 11:59:09 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-11-13 07:50:20 -0700 |
commit | 6a31fd8d732afd232d6a99708192170e13129374 (patch) | |
tree | a02c4dc471e03a5b54820a03776097ffc1a5e08f /src | |
parent | 719a95aa9dca00c83c6da57fbdd5c2ae7acaa1f8 (diff) | |
download | coreutils-6a31fd8d732afd232d6a99708192170e13129374.tar.xz |
build: update gnulib, for getgroups improvements
A replacement getgroups is now guaranteed to exist, but it may
fail with ENOSYS. mgetgroups is moved to gnulib, and now takes
gid_t instead of GETGROUPS_T (but setgroups still needs GETGROUPS_T).
* gnulib: Update to latest.
* gl/modules/mgetgroups: Delete, moved to gnulib.
* gl/m4/mgetgroups.m4: Likewise.
* gl/lib/mgetgroups.h: Likewise.
* gl/lib/mgetgroups.c: Likewise.
* src/group-list.c (print_group_list): Adjust callers.
* src/id.c (print_full_info): Likewise.
Diffstat (limited to 'src')
-rw-r--r-- | src/group-list.c | 6 | ||||
-rw-r--r-- | src/id.c | 6 |
2 files changed, 4 insertions, 8 deletions
diff --git a/src/group-list.c b/src/group-list.c index 4c5391ddb..1fadd0c57 100644 --- a/src/group-list.c +++ b/src/group-list.c @@ -54,14 +54,13 @@ print_group_list (const char *username, ok = false; } -#if HAVE_GETGROUPS { - GETGROUPS_T *groups; + gid_t *groups; int i; int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), &groups); - if (n_groups < 0) + if (n_groups < 0 && errno != ENOSYS) { if (username) { @@ -84,7 +83,6 @@ print_group_list (const char *username, } free (groups); } -#endif /* HAVE_GETGROUPS */ return ok; } @@ -292,14 +292,13 @@ print_full_info (const char *username) printf ("(%s)", grp->gr_name); } -#if HAVE_GETGROUPS { - GETGROUPS_T *groups; + gid_t *groups; int i; int n_groups = mgetgroups (username, (pwd ? pwd->pw_gid : (gid_t) -1), &groups); - if (n_groups < 0) + if (n_groups < 0 && errno != ENOSYS) { if (username) { @@ -327,7 +326,6 @@ print_full_info (const char *username) } free (groups); } -#endif /* HAVE_GETGROUPS */ /* POSIX mandates the precise output format, and that it not include any context=... part, so skip that if POSIXLY_CORRECT is set. */ |