aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/grp.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-06-16 09:12:29 +0000
committerCorinna Vinschen <corinna@vinschen.de>2014-06-16 09:12:29 +0000
commit6681d11fd3464c7ba9a74e7f594dcbd3eb96688a (patch)
tree8e8aac5a39d0b94f20249fb90e9287ff89ba21b5 /winsup/cygwin/grp.cc
parent84600df21d81d6572fdf12735ea636cf4f6507bd (diff)
downloadnewlib-6681d11fd3464c7ba9a74e7f594dcbd3eb96688a.zip
newlib-6681d11fd3464c7ba9a74e7f594dcbd3eb96688a.tar.gz
newlib-6681d11fd3464c7ba9a74e7f594dcbd3eb96688a.tar.bz2
* grp.cc (getgrouplist): Fix setting ngroups to make sure to return
the right value.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r--winsup/cygwin/grp.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 43cae6d..f7ce61b 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -656,11 +656,11 @@ getgrouplist (const char *user, gid_t gid, gid_t *groups, int *ngroups)
groups[cnt] = grp->gr_gid;
++cnt;
}
- *ngroups = cnt;
if (cnt > *ngroups)
ret = -1;
else
ret = cnt;
+ *ngroups = cnt;
syscall_printf ( "%d = getgrouplist(%s, %u, %p, %d)",
ret, user, gid, groups, *ngroups);