test can be allowed to run if fopen() is capable of fopen()ing
three additional files once that we have already open()ed the big bunch of file descriptors.
This commit is contained in:
parent
8fe9376d54
commit
8a529bd987
@ -67,21 +67,21 @@ static void close_file_descriptors(void)
|
|||||||
|
|
||||||
static int fopen_works(void)
|
static int fopen_works(void)
|
||||||
{
|
{
|
||||||
FILE *fpa[SAFETY_MARGIN];
|
FILE *fpa[3];
|
||||||
int i;
|
int i;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
for (i = 0; i < SAFETY_MARGIN; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
fpa[i] = NULL;
|
fpa[i] = NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < SAFETY_MARGIN; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
fpa[i] = fopen(DEV_NULL, "r");
|
fpa[i] = fopen(DEV_NULL, "r");
|
||||||
if (fpa[i] == NULL) {
|
if (fpa[i] == NULL) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < SAFETY_MARGIN; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (fpa[i] != NULL)
|
if (fpa[i] != NULL)
|
||||||
fclose(fpa[i]);
|
fclose(fpa[i]);
|
||||||
}
|
}
|
||||||
|
@ -68,21 +68,21 @@ static void close_file_descriptors(void)
|
|||||||
|
|
||||||
static int fopen_works(void)
|
static int fopen_works(void)
|
||||||
{
|
{
|
||||||
FILE *fpa[SAFETY_MARGIN];
|
FILE *fpa[3];
|
||||||
int i;
|
int i;
|
||||||
int ret = 1;
|
int ret = 1;
|
||||||
|
|
||||||
for (i = 0; i < SAFETY_MARGIN; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
fpa[i] = NULL;
|
fpa[i] = NULL;
|
||||||
}
|
}
|
||||||
for (i = 0; i < SAFETY_MARGIN; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
fpa[i] = fopen(DEV_NULL, "r");
|
fpa[i] = fopen(DEV_NULL, "r");
|
||||||
if (fpa[i] == NULL) {
|
if (fpa[i] == NULL) {
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = 0; i < SAFETY_MARGIN; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (fpa[i] != NULL)
|
if (fpa[i] != NULL)
|
||||||
fclose(fpa[i]);
|
fclose(fpa[i]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user