aboutsummaryrefslogtreecommitdiffstats
path: root/rsync.c
diff options
context:
space:
mode:
authorDavid Dykstra <dwd@samba.org>1999-03-02 16:42:46 +0000
committerDavid Dykstra <dwd@samba.org>1999-03-02 16:42:46 +0000
commit9422bb3fdf16ae5a3d726e41435ba405b4c22a8e (patch)
tree47acfb9c509d8d3c4166f5a3628b2183a86cabe7 /rsync.c
parent5afd8aedce004cc11700285c16ea84f1e857d473 (diff)
downloadandroid_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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rsync.c b/rsync.c
index 1d62abc4..02dd8373 100644
--- a/rsync.c
+++ b/rsync.c
@@ -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);
}
}