getgroups: avoid calling exit
authorEric Blake <ebb9@byu.net>
Thu, 12 Nov 2009 16:30:38 +0000 (09:30 -0700)
committerEric Blake <ebb9@byu.net>
Fri, 13 Nov 2009 14:39:01 +0000 (07:39 -0700)
commit80074d103cc72ea8f289b82c56bd3734aac82cd7
tree72e0fb647722600449fb0675283e764df9da1d70
parent08e6b4c6ba690adba619a3c1695bc312d3e98136
getgroups: avoid calling exit

rpl_getgroups should be a library function, comparable to glibc.

* modules/getgroups (Depends-on): Add malloc-posix and unistd,
drop xalloc.
* modules/getgroups-tests (Depends-on, Makefile.am): Drop unneeded
dependencies.
* lib/getgroups.c (rpl_getgroups): Fail with ENOMEM rather than
exiting, in the rare case of malloc failure.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/getgroups.c
modules/getgroups
modules/getgroups-tests