summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglen.beasley%sun.com <devnull@localhost>2008-01-27 00:45:13 +0000
committerglen.beasley%sun.com <devnull@localhost>2008-01-27 00:45:13 +0000
commitb20b507ca0796b5d6900945b7c067ea858705c3a (patch)
tree8af99e32abc67760fc6a637f91c917c2d9a2fe45
parentcfc39465d6e635150960339902bbfa3afb468435 (diff)
downloadnspr-hg-b20b507ca0796b5d6900945b7c067ea858705c3a.tar.gz
307573 prpollml requires file descriptors greater than 256 r=wtc
-rw-r--r--pr/tests/prpollml.c16
-rwxr-xr-xpr/tests/runtests.sh10
2 files changed, 19 insertions, 7 deletions
diff --git a/pr/tests/prpollml.c b/pr/tests/prpollml.c
index 720b525c..d20f1967 100644
--- a/pr/tests/prpollml.c
+++ b/pr/tests/prpollml.c
@@ -67,7 +67,7 @@ static void Test(void)
if (rv != 0) {
fprintf(stderr,
"PR_Poll should time out but returns %d (%d, %d)\n",
- rv, PR_GetError(), PR_GetOSError());
+ (int) rv, (int) PR_GetError(), (int) PR_GetOSError());
exit(1);
}
}
@@ -75,7 +75,8 @@ static void Test(void)
for (i = POLL_DESC_COUNT; i >= 1; i--) {
rv = PR_Poll(pd, i, timeout);
if (rv != 0) {
- fprintf(stderr, "PR_Poll should time out but returns %d\n", rv);
+ fprintf(stderr, "PR_Poll should time out but returns %d\n",
+ (int) rv);
exit(1);
}
}
@@ -100,15 +101,20 @@ int main(int argc, char **argv)
for (i = 0; i < POLL_DESC_COUNT; i++) {
sock = PR_NewTCPSocket();
if (sock == NULL) {
- fprintf(stderr, "PR_NewTCPSocket failed\n");
+ fprintf(stderr, "PR_NewTCPSocket failed (%d, %d)\n",
+ (int) PR_GetError(), (int) PR_GetOSError());
+ fprintf(stderr, "Ensure the per process file descriptor limit "
+ "is greater than %d.", POLL_DESC_COUNT);
exit(1);
}
if (PR_Bind(sock, &addr) == PR_FAILURE) {
- fprintf(stderr, "PR_Bind failed\n");
+ fprintf(stderr, "PR_Bind failed (%d, %d)\n",
+ (int) PR_GetError(), (int) PR_GetOSError());
exit(1);
}
if (PR_Listen(sock, 5) == PR_FAILURE) {
- fprintf(stderr, "PR_Listen failed\n");
+ fprintf(stderr, "PR_Listen failed (%d, %d)\n",
+ (int) PR_GetError(), (int) PR_GetOSError());
exit(1);
}
diff --git a/pr/tests/runtests.sh b/pr/tests/runtests.sh
index bb4a65eb..f9149481 100755
--- a/pr/tests/runtests.sh
+++ b/pr/tests/runtests.sh
@@ -37,17 +37,23 @@
# ***** END LICENSE BLOCK *****
#
-# tests.ksh
-# korn shell script for nspr tests
+# runtests.sh
+# Bourne shell script for nspr tests
#
SYSTEM_INFO=`uname -a`
OS_ARCH=`uname -s`
+
if [ $OS_ARCH = "Windows_NT" ] || [ $OS_ARCH = "OS/2" ]
then
NULL_DEVICE=nul
else
NULL_DEVICE=/dev/null
+ FILE_D=`ulimit -n`
+ if [ $FILE_D -lt 512 ]
+ then
+ ulimit -n 512
+ fi
fi
#