public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH] fcntl/fcntl14: break remaining tests if cannot fork
@ 2016-04-11 14:27 Han Pingtian
  2016-04-12 10:52 ` Cyril Hrubis
  0 siblings, 1 reply; 2+ messages in thread
From: Han Pingtian @ 2016-04-11 14:27 UTC (permalink / raw)
  To: ltp

It has been observed that if the test continued after the failure of
fork, a lot of other processes on the same machine will be killed by
the signal handler catch_alarm().

Signed-off-by: Han Pingtian <hanpt@linux.vnet.ibm.com>
---
 testcases/kernel/syscalls/fcntl/fcntl14.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl14.c b/testcases/kernel/syscalls/fcntl/fcntl14.c
index a6c8215..68e110e 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl14.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl14.c
@@ -755,6 +755,7 @@ void dochild(void)
 		switch (pid) {
 		case -1:
 			tst_resm(TFAIL, "Fork failed");
+			fail = 1;
 			break;
 		case 0:	/* child */
 #ifdef UCLINUX
@@ -872,8 +873,7 @@ void run_test(int file_flag, int file_mode, int seek, int start, int end)
 #endif
 		}
 		if (child < 0) {
-			tst_resm(TFAIL, "Fork failed");
-			cleanup();
+			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed");
 		}
 		/* parent process */
 		if ((thiscase->c_flag) == WILLBLOCK) {
@@ -1145,8 +1145,7 @@ int main(int ac, char **av)
 #endif
 		}
 		if (child < 0) {
-			tst_resm(TFAIL, "Fork failed");
-			cleanup();
+			tst_brkm(TBROK|TERRNO, cleanup, "Fork failed");
 		}
 
 		/* parent process */
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [LTP] [PATCH] fcntl/fcntl14: break remaining tests if cannot fork
  2016-04-11 14:27 [LTP] [PATCH] fcntl/fcntl14: break remaining tests if cannot fork Han Pingtian
@ 2016-04-12 10:52 ` Cyril Hrubis
  0 siblings, 0 replies; 2+ messages in thread
From: Cyril Hrubis @ 2016-04-12 10:52 UTC (permalink / raw)
  To: ltp

Hi!
Pushed, thanks.

-- 
Cyril Hrubis
chrubis@suse.cz

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-12 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-11 14:27 [LTP] [PATCH] fcntl/fcntl14: break remaining tests if cannot fork Han Pingtian
2016-04-12 10:52 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox