diff options
| author | Alan Somers <asomers@FreeBSD.org> | 2024-12-31 20:41:01 +0000 |
|---|---|---|
| committer | Alan Somers <asomers@FreeBSD.org> | 2025-01-20 16:54:45 +0000 |
| commit | 3dc01440a064c95bc5f125acf7c0ef6acbb5c257 (patch) | |
| tree | a01c1a0f09e54c6a5a4564549cb10d0ddd6fadc1 /lib/libc | |
| parent | 09df42f1d5925a81c76da163f0f6d647129729c6 (diff) | |
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/tests/nss/getgr_test.c | 4 | ||||
| -rw-r--r-- | lib/libc/tests/nss/getpw_test.c | 4 | ||||
| -rw-r--r-- | lib/libc/tests/nss/getserv_test.c | 4 |
3 files changed, 12 insertions, 0 deletions
diff --git a/lib/libc/tests/nss/getgr_test.c b/lib/libc/tests/nss/getgr_test.c index 7c0e265fa6f6..974632d4b7c7 100644 --- a/lib/libc/tests/nss/getgr_test.c +++ b/lib/libc/tests/nss/getgr_test.c @@ -293,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) { @@ -303,6 +305,8 @@ group_fill_test_data(struct group_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endgrent(); diff --git a/lib/libc/tests/nss/getpw_test.c b/lib/libc/tests/nss/getpw_test.c index 3a44497cf848..434d86a31591 100644 --- a/lib/libc/tests/nss/getpw_test.c +++ b/lib/libc/tests/nss/getpw_test.c @@ -240,6 +240,8 @@ passwd_fill_test_data(struct passwd_test_data *td, int (*cb)(struct passwd *, void *)) { struct passwd *pwd; + const int limit = 1024; + int count = 0; setpassent(1); while ((pwd = getpwent()) != NULL) { @@ -250,6 +252,8 @@ passwd_fill_test_data(struct passwd_test_data *td, } else { return (-1); } + if (++count >= limit) + break; } endpwent(); diff --git a/lib/libc/tests/nss/getserv_test.c b/lib/libc/tests/nss/getserv_test.c index 486a8c20836f..cc66fdb2fa52 100644 --- a/lib/libc/tests/nss/getserv_test.c +++ b/lib/libc/tests/nss/getserv_test.c @@ -283,6 +283,8 @@ static int servent_fill_test_data(struct servent_test_data *td) { struct servent *serv; + const int limit = 1024; + int count = 0; setservent(1); while ((serv = getservent()) != NULL) { @@ -290,6 +292,8 @@ servent_fill_test_data(struct servent_test_data *td) TEST_DATA_APPEND(servent, td, serv); else return (-1); + if (++count >= limit) + break; } endservent(); |
