diff options
author | David Dykstra <dwd@samba.org> | 1999-03-02 16:42:46 +0000 |
---|---|---|
committer | David Dykstra <dwd@samba.org> | 1999-03-02 16:42:46 +0000 |
commit | 9422bb3fdf16ae5a3d726e41435ba405b4c22a8e (patch) | |
tree | 47acfb9c509d8d3c4166f5a3628b2183a86cabe7 /rsync.c | |
parent | 5afd8aedce004cc11700285c16ea84f1e857d473 (diff) | |
download | android_external_rsync-9422bb3fdf16ae5a3d726e41435ba405b4c22a8e.tar.gz android_external_rsync-9422bb3fdf16ae5a3d726e41435ba405b4c22a8e.tar.bz2 android_external_rsync-9422bb3fdf16ae5a3d726e41435ba405b4c22a8e.zip |
Change getgroups to use GETGROUPS_T as the type of the group array returned,
as calculated by the configure macro AC_TYPE_GETGROUPS. Without that, it
doesn't work properly on systems like sunos 4 where gid_t is defined to
be an unsigned short but getgroups is defined to return an array of integers.
Diffstat (limited to 'rsync.c')
-rw-r--r-- | rsync.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -115,10 +115,10 @@ int delete_file(char *fname) static int is_in_group(gid_t gid) { -#ifdef HAVE_GETGROUPS +#ifdef GETGROUPS_T static gid_t last_in = (gid_t) -2, last_out; static int ngroups = -2; - static gid_t *gidset; + static GETGROUPS_T *gidset; int n; if (gid == last_in) @@ -127,7 +127,7 @@ static int is_in_group(gid_t gid) /* treat failure (-1) as if not member of any group */ ngroups = getgroups(0, 0); if (ngroups > 0) { - gidset = (gid_t *) malloc(ngroups * sizeof(gid_t)); + gidset = (GETGROUPS_T *) malloc(ngroups * sizeof(GETGROUPS_T)); ngroups = getgroups(ngroups, gidset); } } |