Skip to contentSkip to conversation

ftest06.c: fix error of the child process need exit

PATCH In review Peng Haitao 3 participants 3 messages Mar 12, 2011 – Mar 15, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftest06.c: fix error of the child process need exit

The child process should exit after invoking dotest().

---
 testcases/kernel/fs/ftest/ftest06.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
testcases/kernel/fs/ftest/ftest06.c +2 -5
index d8ff8b6..18eae5d 100644
@@ -110,9 +110,8 @@ int main(int ac, char *av[])
 	/*
 	 * parse standard options
 	 */
-	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
-	}
 
 	/*
 	 * Default values for run conditions.
@@ -162,7 +161,7 @@ int main(int ac, char *av[])
 		for (k = 0; k < nchild; k++) {
 			if ((child = fork()) == 0) {
 				dotest(k, iterations);
-
+				tst_exit();
 			}
 			if (child < 0) {
 				tst_brkm(TBROK|TERRNO, cleanup, "fork failed");
@@ -239,8 +238,6 @@ int main(int ac, char *av[])
 		}
 
 		sync();
-		cleanup();
-
 	}
 
 	if (local_flag == FAILED)
Signature · 16 lines
1.7.1

-- 
Best Regards,
Peng Haitao


------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Tested-by on v1 1/1
#1 lore raw
Quoted 4 lines · Peng Haitao

The child process should exit after invoking dotest().

Confirmed this patch and the other ftest06 patch both work on RHEL6.

Quoted 37 lines
---
 testcases/kernel/fs/ftest/ftest06.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)
testcases/kernel/fs/ftest/ftest06.c +2 -5
index d8ff8b6..18eae5d 100644
@@ -110,9 +110,8 @@ int main(int ac, char *av[])
 	/*
 	 * parse standard options
 	 */
-	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
+	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL)
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
-	}
 
 	/*
 	 * Default values for run conditions.
@@ -162,7 +161,7 @@ int main(int ac, char *av[])
 		for (k = 0; k < nchild; k++) {
 			if ((child = fork()) == 0) {
 				dotest(k, iterations);
-
+				tst_exit();
 			}
 			if (child < 0) {
 				tst_brkm(TBROK|TERRNO, cleanup, "fork failed");
@@ -239,8 +238,6 @@ int main(int ac, char *av[])
 		}
 
 		sync();
-		cleanup();
-
 	}
 
 	if (local_flag == FAILED)
Signature · 14 lines
Quality Engineer (Kernel) in
Red Hat Software (Beijing) Co., R&D Branch
http://www.cn.redhat.com/
TEL: +86-10-62608150

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw
In reply to Peng Haitao
Quoted 2 lines · Peng Haitao

The child process should exit after invoking dotest().

Committed -- thanks.
-Garrett

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Ltp-list mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list