From: Michael Sweet Date: Wed, 21 Sep 2016 16:55:51 +0000 (-0400) Subject: Resolve new build warnings on macOS (Issue #4881) X-Git-Tag: v2.2.1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdc3c81a67ef52929e88dcf1378bbf90e04750b9;p=thirdparty%2Fcups.git Resolve new build warnings on macOS (Issue #4881) --- diff --git a/scheduler/auth.c b/scheduler/auth.c index 2af443d516..a73a1e09da 100644 --- a/scheduler/auth.c +++ b/scheduler/auth.c @@ -1180,10 +1180,18 @@ cupsdCheckGroup( if (user) { int ngroups; /* Number of groups */ +# ifdef __APPLE__ + int groups[2048]; /* Groups that user belongs to */ +# else gid_t groups[2048]; /* Groups that user belongs to */ +# endif /* __APPLE__ */ ngroups = (int)(sizeof(groups) / sizeof(groups[0])); +# ifdef __APPLE__ + getgrouplist(username, (int)user->pw_gid, groups, &ngroups); +# else getgrouplist(username, user->pw_gid, groups, &ngroups); +#endif /* __APPLE__ */ for (i = 0; i < ngroups; i ++) if (group->gr_gid == groups[i])