aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2007-04-04 08:58:36 +0000
committerYang Tse <yangsita@gmail.com>2007-04-04 08:58:36 +0000
commit5625e5d5b87cf4037705fc03df9e6c9f4bcdf0a1 (patch)
tree3a822a5dd1bf708f18dcbf59fb4105c76f951326 /tests/libtest
parent8a529bd98764f023680d750d76e138bc644e50a6 (diff)
add debug message and expand comment
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib518.c13
-rw-r--r--tests/libtest/lib537.c13
2 files changed, 22 insertions, 4 deletions
diff --git a/tests/libtest/lib518.c b/tests/libtest/lib518.c
index 1997b2f9e..b2aa0554c 100644
--- a/tests/libtest/lib518.c
+++ b/tests/libtest/lib518.c
@@ -77,6 +77,8 @@ static int fopen_works(void)
for (i = 0; i < 3; i++) {
fpa[i] = fopen(DEV_NULL, "r");
if (fpa[i] == NULL) {
+ store_errmsg("fopen() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
ret = 0;
break;
}
@@ -394,11 +396,18 @@ static int rlimit(int keep_open)
#endif /* using a FD_SETSIZE bound select() */
- /* test stdio's capability to fopen() SAFETY_MARGIN additional files */
+ /*
+ * Old or 'backwards compatible' implementations of stdio do not allow
+ * handling of streams with an underlying file descriptor number greater
+ * than 255, even when allowing high numbered file descriptors for sockets.
+ * At this point we have a big number of file descriptors which have been
+ * opened using dup(), so lets test the stdio implementation and discover
+ * if it is capable of fopen()ing some additional files.
+ */
if (!fopen_works()) {
sprintf(strbuff1, fmt, num_open.rlim_max);
- sprintf(strbuff, "stdio fopen() fails with %s open() files",
+ sprintf(strbuff, "stdio fopen() fails with %s fds open()",
strbuff1);
store_errmsg(strbuff, 0);
fprintf(stderr, "%s\n", msgbuff);
diff --git a/tests/libtest/lib537.c b/tests/libtest/lib537.c
index d59957430..eecda4626 100644
--- a/tests/libtest/lib537.c
+++ b/tests/libtest/lib537.c
@@ -78,6 +78,8 @@ static int fopen_works(void)
for (i = 0; i < 3; i++) {
fpa[i] = fopen(DEV_NULL, "r");
if (fpa[i] == NULL) {
+ store_errmsg("fopen() failed", ERRNO);
+ fprintf(stderr, "%s\n", msgbuff);
ret = 0;
break;
}
@@ -397,11 +399,18 @@ static int rlimit(int keep_open)
#endif /* using a FD_SETSIZE bound select() */
- /* test stdio's capability to fopen() SAFETY_MARGIN additional files */
+ /*
+ * Old or 'backwards compatible' implementations of stdio do not allow
+ * handling of streams with an underlying file descriptor number greater
+ * than 255, even when allowing high numbered file descriptors for sockets.
+ * At this point we have a big number of file descriptors which have been
+ * opened using dup(), so lets test the stdio implementation and discover
+ * if it is capable of fopen()ing some additional files.
+ */
if (!fopen_works()) {
sprintf(strbuff1, fmt, num_open.rlim_max);
- sprintf(strbuff, "stdio fopen() fails with %s open() files",
+ sprintf(strbuff, "stdio fopen() fails with %s fds open()",
strbuff1);
store_errmsg(strbuff, 0);
fprintf(stderr, "%s\n", msgbuff);