aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/libtest/lib518.c3
-rw-r--r--tests/libtest/lib537.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c
index 756f301d9..a04d2ec82 100644
--- a/tests/libtest/lib518.c
+++ b/tests/libtest/lib518.c
@@ -384,7 +384,8 @@ static int rlimit(int keep_open)
for (rl.rlim_cur = 0;
rl.rlim_cur < num_open.rlim_max;
rl.rlim_cur++) {
- if (fd[rl.rlim_cur] > num_open.rlim_cur) {
+ if ((fd[rl.rlim_cur] > 0) &&
+ ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur) {
sprintf(strbuff, "select limit is FD_SETSIZE %d", FD_SETSIZE);
store_errmsg(strbuff, 0);
fprintf(stderr, "%s\n", msgbuff);
diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c
index a074bf994..ee7bd9b6b 100644
--- a/tests/libtest/lib537.c
+++ b/tests/libtest/lib537.c
@@ -387,7 +387,8 @@ static int rlimit(int keep_open)
for (rl.rlim_cur = 0;
rl.rlim_cur < num_open.rlim_max;
rl.rlim_cur++) {
- if (fd[rl.rlim_cur] > num_open.rlim_cur) {
+ if ((fd[rl.rlim_cur] > 0) &&
+ ((unsigned int)fd[rl.rlim_cur] > num_open.rlim_cur) {
sprintf(strbuff, "select limit is FD_SETSIZE %d", FD_SETSIZE);
store_errmsg(strbuff, 0);
fprintf(stderr, "%s\n", msgbuff);