Commit 1df395f7 authored by Wayne Davison's avatar Wayne Davison

Use the new HAVE_GETGROUPS define.

parent 5fdf2e70
......@@ -39,10 +39,14 @@ main(UNUSED(int argc), UNUSED(char *argv[]))
gid_t gid = MY_GID();
int gid_in_list = 0;
#ifdef HAVE_GETGROUPS
if ((n = getgroups(NGROUPS_MAX, list)) < 0) {
perror("getgroups");
return 1;
}
#else
n = 0;
#endif
for (i = 0; i < n; i++) {
printf("%lu ", (unsigned long)list[i]);
......
......@@ -25,7 +25,10 @@
#include "rsync.h"
#ifdef GETGROUPS_T
#ifdef HAVE_GETGROUPS
# if !defined(GETGROUPS_T)
# define GETGROUPS_T gid_t
# endif
# ifndef NGROUPS_MAX
/* It ought to be defined, but just in case. */
# define NGROUPS_MAX 32
......@@ -117,7 +120,7 @@ static uid_t match_uid(uid_t uid)
static int is_in_group(gid_t gid)
{
#ifdef GETGROUPS_T
#ifdef HAVE_GETGROUPS
static gid_t last_in = GID_NONE, last_out;
static int ngroups = -2;
static GETGROUPS_T *gidset;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment