aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/tests/nss/getgr_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/tests/nss/getgr_test.c')
-rw-r--r--lib/libc/tests/nss/getgr_test.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c
index 28c5e2e98028..974632d4b7c7 100644
--- a/lib/libc/tests/nss/getgr_test.c
+++ b/lib/libc/tests/nss/getgr_test.c
@@ -25,7 +25,6 @@
*
*/
-#include <sys/cdefs.h>
#include <arpa/inet.h>
#include <errno.h>
#include <grp.h>
@@ -294,6 +293,8 @@ group_fill_test_data(struct group_test_data *td,
int (*cb)(struct group *, void *))
{
struct group *grp;
+ const int limit = 1024;
+ int count = 0;
setgroupent(1);
while ((grp = getgrent()) != NULL) {
@@ -304,6 +305,8 @@ group_fill_test_data(struct group_test_data *td,
} else {
return (-1);
}
+ if (++count >= limit)
+ break;
}
endgrent();