handle another out-of-memory in fork(). the policy here is not consistent,

since other calls (e.g. exec()) panic on out of memory.
This commit is contained in:
Robert Morris 2020-08-13 10:22:07 -04:00 committed by Frans Kaashoek
parent bc51626aab
commit 8dc71a257d
3 changed files with 10 additions and 3 deletions

View file

@ -2507,6 +2507,8 @@ main(int argc, char *argv[])
if(argc == 2 && strcmp(argv[1], "-c") == 0){
continuous = 1;
} else if(argc == 2 && strcmp(argv[1], "-C") == 0){
continuous = 2;
} else if(argc == 2 && argv[1][0] != '-'){
justone = argv[1];
} else if(argc > 1){
@ -2589,12 +2591,14 @@ main(int argc, char *argv[])
}
if(fail){
printf("SOME TESTS FAILED\n");
exit(1);
if(continuous != 2)
exit(1);
}
int free1 = countfree();
if(free1 < free0){
printf("FAILED -- lost some free pages\n");
exit(1);
if(continuous != 2)
exit(1);
}
}
}