summaryrefslogtreecommitdiffstats
path: root/source/lib/system.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/system.c')
-rw-r--r--source/lib/system.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/lib/system.c b/source/lib/system.c
index b020a203730..2e95efec79b 100644
--- a/source/lib/system.c
+++ b/source/lib/system.c
@@ -693,7 +693,6 @@ int sys_getgroups(int setlen, gid_t *gidset)
#endif /* HAVE_BROKEN_GETGROUPS */
}
-#ifdef HAVE_SETGROUPS
/**************************************************************************
Wrapper for setgroups. Deals with broken (int) case. Automatically used
@@ -702,6 +701,11 @@ int sys_getgroups(int setlen, gid_t *gidset)
int sys_setgroups(int setlen, gid_t *gidset)
{
+#if !defined(HAVE_SETGROUPS)
+ errno = ENOSYS;
+ return -1;
+#endif /* HAVE_SETGROUPS */
+
#if !defined(HAVE_BROKEN_GETGROUPS)
return setgroups(setlen, gidset);
#else
@@ -742,8 +746,6 @@ int sys_setgroups(int setlen, gid_t *gidset)
#endif /* HAVE_BROKEN_GETGROUPS */
}
-#endif /* HAVE_SETGROUPS */
-
/**************************************************************************
Wrappers for setpwent(), getpwent() and endpwent()
****************************************************************************/