[LTP] [PATCH] waitpid/waitpid03: break test if fork failed
Han Pingtian
hanpt@linux.vnet.ibm.com
Tue Apr 12 15:22:56 CEST 2016
If continue after the fork failure, a lot of processes may be killed by
the kill() on line 125.
Signed-off-by: Han Pingtian <hanpt@linux.vnet.ibm.com>
---
testcases/kernel/syscalls/waitpid/waitpid03.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/testcases/kernel/syscalls/waitpid/waitpid03.c b/testcases/kernel/syscalls/waitpid/waitpid03.c
index 2599a92..648870c 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid03.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid03.c
@@ -106,7 +106,8 @@ int main(int argc, char **argv)
if (DEBUG)
tst_resm(TINFO, "child # %d", ikids);
} else if (pid[ikids] == -1) {
- tst_resm(TFAIL, "cannot open fork #%d", ikids);
+ tst_brkm(TBROK|TERRNO, cleanup,
+ "cannot open fork #%d", ikids);
} else {
#ifdef UCLINUX
if (self_exec(argv[0], "d", ikids) < 0) {
--
1.9.3
More information about the ltp
mailing list