* [LTP] [PATCH] waitid/waitid01: break test if fork() failed
@ 2016-04-14 8:04 Han Pingtian
2016-04-18 19:15 ` Cyril Hrubis
0 siblings, 1 reply; 2+ messages in thread
From: Han Pingtian @ 2016-04-14 8:04 UTC (permalink / raw)
To: ltp
Or a lot of processes will be killed when -1 passed as pid to kill().
Signed-off-by: Han Pingtian <hanpt@linux.vnet.ibm.com>
---
testcases/kernel/syscalls/waitid/waitid01.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/testcases/kernel/syscalls/waitid/waitid01.c b/testcases/kernel/syscalls/waitid/waitid01.c
index c19f0da..1729aa3 100644
--- a/testcases/kernel/syscalls/waitid/waitid01.c
+++ b/testcases/kernel/syscalls/waitid/waitid01.c
@@ -130,6 +130,10 @@ int main(int ac, char **av)
for (testno = 0; testno < TST_TOTAL; ++testno) {
TEST(fork());
+ if (TEST_RETURN < 0)
+ tst_brkm(TBROK | TTERRNO, NULL,
+ "fork() failed");
+
if (TEST_RETURN == 0) {
exit(123);
} else {
@@ -143,6 +147,10 @@ int main(int ac, char **av)
}
TEST(fork());
+ if (TEST_RETURN < 0)
+ tst_brkm(TBROK | TTERRNO, NULL,
+ "fork() failed");
+
if (TEST_RETURN == 0) {
int a, b = 0;
a = 1 / b;
@@ -157,6 +165,10 @@ int main(int ac, char **av)
}
TEST(pid = fork());
+ if (TEST_RETURN < 0)
+ tst_brkm(TBROK | TTERRNO, NULL,
+ "fork() failed");
+
if (TEST_RETURN == 0) {
TEST(sleep(10));
tst_exit();
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [LTP] [PATCH] waitid/waitid01: break test if fork() failed
2016-04-14 8:04 [LTP] [PATCH] waitid/waitid01: break test if fork() failed Han Pingtian
@ 2016-04-18 19:15 ` Cyril Hrubis
0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2016-04-18 19:15 UTC (permalink / raw)
To: ltp
Hi!
> Or a lot of processes will be killed when -1 passed as pid to kill().
Pushed, thanks.
--
Cyril Hrubis
chrubis@suse.cz
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-04-18 19:15 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-14 8:04 [LTP] [PATCH] waitid/waitid01: break test if fork() failed Han Pingtian
2016-04-18 19:15 ` Cyril Hrubis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.