* src/groups.c: sys_ngroups is only used when HAVE_GETGROUPS is

defined.
This commit is contained in:
nekral-guest 2008-06-13 21:29:13 +00:00
parent ba7dde0168
commit dd8a09ce8d
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,8 @@
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
* src/groups.c: sys_ngroups is only used when HAVE_GETGROUPS is
defined.
2008-06-13 Nicolas François <nicolas.francois@centraliens.net>
* src/faillog.c: Ignore return value of time() when use with a

View File

@ -106,9 +106,8 @@ static void print_groups (const char *member)
*/
int main (int argc, char **argv)
{
long sys_ngroups;
#ifdef HAVE_GETGROUPS
long sys_ngroups;
int ngroups;
GETGROUPS_T *groups;
int pri_grp; /* TODO: should be GETGROUPS_T */
@ -118,9 +117,9 @@ int main (int argc, char **argv)
char *getlogin ();
#endif
sys_ngroups = sysconf (_SC_NGROUPS_MAX);
#ifdef HAVE_GETGROUPS
groups = (GETGROUPS_T *) malloc (sys_ngroups * sizeof (GETGROUPS_T));
sys_ngroups = sysconf (_SC_NGROUPS_MAX);
groups = (GETGROUPS_T *) malloc (sizeof (GETGROUPS_T) * sys_ngroups);
#endif
(void) setlocale (LC_ALL, "");
(void) bindtextdomain (PACKAGE, LOCALEDIR);