summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Duft <mduft@gentoo.org>2011-09-08 11:18:17 +0200
committerJim Meyering <meyering@redhat.com>2011-10-01 19:17:21 +0200
commit7289f125886db5e900eed52a62e89de8f802863a (patch)
tree561768041ecb281e306696e76313594840c7aea0
parente1c589ecd56a8ef89d1250d2e81de8847e97c69c (diff)
downloadcoreutils-7289f125886db5e900eed52a62e89de8f802863a.tar.xz
build: accommodate missing setgroups on Interix
Add a dummy, non-functional, always-successful replacement setgroups function, to keep the original code untouched and simple. * src/chroot.c (setgroups) [! HAVE_SETGROUPS]: Define.
-rw-r--r--src/chroot.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/chroot.c b/src/chroot.c
index 95c227b36..8bd39fcb2 100644
--- a/src/chroot.c
+++ b/src/chroot.c
@@ -52,6 +52,17 @@ static struct option const long_opts[] =
{NULL, 0, NULL, 0}
};
+#if ! HAVE_SETGROUPS
+/* At least Interix lacks supplemental group support. Define an
+ always-successful replacement to avoid checking for setgroups
+ availability everywhere, just to support broken platforms. */
+static int
+setgroups (size_t size ATTRIBUTE_UNUSED, gid_t const *list ATTRIBUTE_UNUSED)
+{
+ return 0;
+}
+#endif
+
/* Call setgroups to set the supplementary groups to those listed in GROUPS.
GROUPS is a comma separated list of supplementary groups (names or numbers).
Parse that list, converting any names to numbers, and call setgroups on the