getgroups: avoid calling exit
authorEric Blake <ebb9@byu.net>
Thu, 12 Nov 2009 16:30:38 +0000 (09:30 -0700)
committerIan Beckwith <ianb@erislabs.net>
Sun, 15 Nov 2009 03:10:08 +0000 (03:10 +0000)
commitd9cc1a469fab2ac78a99ba6b9357051ed0deeafc
tree9d6827c2f448b144853a327c3921078ac95941af
parent82a192ddd8b181141a09d100bd2bfe3b6e8507cc
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>
(cherry picked from commit 80074d103cc72ea8f289b82c56bd3734aac82cd7)
ChangeLog
lib/getgroups.c
modules/getgroups
modules/getgroups-tests