If we can't enable MAX_SWAPFILES swaps - something wrong in
this system, and we must report FAIL. Now result of preparing
swaps ignored and test can report PASS, if next swapon will also
return error.
---
testcases/kernel/syscalls/swapon/swapon03.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/testcases/kernel/syscalls/swapon/swapon03.c
b/testcases/kernel/syscalls/swapon/swapon03.c
index 65b81f3..4778ee1 100644
--- a/testcases/kernel/syscalls/swapon/swapon03.c
+++ b/testcases/kernel/syscalls/swapon/swapon03.c
@@ -213,7 +213,7 @@ int setup_swap()
{
int j, fd; /*j is loop counter, fd is file descriptor*/
int pid; /* used for fork */
- int *status = NULL; /* used for fork */
+ int status; /* used for fork */
int res = 0, pagesize = getpagesize();
int bs, count;
char filename[15]; /* array to store new filename*/
@@ -298,7 +298,12 @@ int setup_swap()
}
tst_exit();
} else
- waitpid(pid, status, 0);
+ waitpid(pid, &status, 0);
+
+ if(WEXITSTATUS(status)) {
+ tst_resm(TFAIL, "Failed to setup swaps");
+ exit(1);
+ }
/* Create all needed extra swapfiles for testing*/
for (j = 0; j < testfiles; j++) {
--
1.5.2.1
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list