• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3  * Copyright (c) 2020 Cyril Hrubis <chrubis@suse.cz>
4  */
5 
6 /*
7  * Test that TBROK is propagated correctly to the results even if we wait on
8  * child and throw away the status.
9  */
10 #include "tst_test.h"
11 
do_test(void)12 static void do_test(void)
13 {
14 	int pid = SAFE_FORK();
15 
16 	if (pid) {
17 		tst_res(TPASS, "Test main pid");
18 		SAFE_WAITPID(pid, NULL, 0);
19 		return;
20 	}
21 
22 	if (tst_variant == 1)
23 		tst_brk(TBROK, "Test child!");
24 	else
25 		tst_brk(TCONF, "Test child!");
26 
27 	tst_res(TPASS, "Test child");
28 }
29 
30 static struct tst_test test = {
31 	.test_all = do_test,
32 	.test_variants = 2,
33 	.forks_child = 1,
34 };
35