aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-09-30 01:01:43 +0000
committerYang Tse <yangsita@gmail.com>2007-09-30 01:01:43 +0000
commit64db60397b9d71a7b0ba381ee80007681b409866 (patch)
treedfa4d992c7e3905bb49b89b3d45f872a9cf2cef1 /tests
parentd243908a018e4d428fb4eddc2c0aa0801a629399 (diff)
Fix comparison between signed and unsigned
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);