Make idev, hlink and file_struct + strings use allocation
[rsync/rsync.git] / getgroups.c
index 4a10fe7..8bb82f5 100644 (file)
@@ -36,13 +36,17 @@ main(UNUSED(int argc), UNUSED(char *argv[]))
 {
        int n, i;
        gid_t list[NGROUPS_MAX];
-       gid_t gid = getgid();
+       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]);