Change tst_resm() followed by tst_exit() to tst_brkm()

Created with coccinelle patch:

@@
expression list L;
expression C != {TINFO, TPASS};
@@
- tst_resm
+ tst_brkm
   (C,
+   NULL,
    L);
- tst_exit();

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
index 87b0be5..e8652e4 100644
--- a/testcases/kernel/syscalls/acct/acct01.c
+++ b/testcases/kernel/syscalls/acct/acct01.c
@@ -115,11 +115,9 @@
 	/* check if acct is implemented in kernel */
 	if (acct(NULL) == -1) {
 		if (errno == ENOSYS) {
-			tst_resm(TCONF,
-				 "BSD process accounting is not configured in "
+			tst_brkm(TCONF,
+				 NULL, "BSD process accounting is not configured in "
 				 "this kernel");
-
-			tst_exit();
 		}
 	}
 }
diff --git a/testcases/kernel/syscalls/eventfd2/eventfd2_03.c b/testcases/kernel/syscalls/eventfd2/eventfd2_03.c
index df9b99c..5335fab 100644
--- a/testcases/kernel/syscalls/eventfd2/eventfd2_03.c
+++ b/testcases/kernel/syscalls/eventfd2/eventfd2_03.c
@@ -121,9 +121,9 @@
 		}
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	if ((fd1 = eventfd2(0, EFD_SEMLIKE)) == -1 ||
 	    (fd2 = eventfd2(0, EFD_SEMLIKE)) == -1) {
diff --git a/testcases/kernel/syscalls/ftruncate/ftruncate04.c b/testcases/kernel/syscalls/ftruncate/ftruncate04.c
index d5779e4..45522e6 100644
--- a/testcases/kernel/syscalls/ftruncate/ftruncate04.c
+++ b/testcases/kernel/syscalls/ftruncate/ftruncate04.c
@@ -252,8 +252,7 @@
 #endif
 
 	if ((fd = open(filename, O_RDWR)) < 0) {
-		tst_resm(TFAIL, "child open");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "child open");
 	}
 	lseek(fd, 0, SEEK_SET);
 	flocks.l_type = F_WRLCK;
@@ -261,13 +260,11 @@
 	flocks.l_start = recstart;
 	flocks.l_len = reclen;
 	if (fcntl(fd, F_SETLKW, &flocks) < 0) {
-		tst_resm(TFAIL, "child fcntl failed");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "child fcntl failed");
 	}
 
 	if (kill(ppid, SIGUSR1) < 0) {
-		tst_resm(TFAIL, "child kill");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "child kill");
 	}
 
 	if (sync_pipe_notify(sync_pipes) == -1)
@@ -292,8 +289,7 @@
 	 * parse standard options
 	 */
 	if ((msg = parse_opts(ac, av, NULL, NULL)) != NULL) {
-		tst_resm(TBROK, "OPTION PARSING ERROR - %s", msg);
-		tst_exit();
+		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 
 	}
 #ifdef UCLINUX
diff --git a/testcases/kernel/syscalls/getcpu/getcpu01.c b/testcases/kernel/syscalls/getcpu/getcpu01.c
index 5be244a..7c073a6 100644
--- a/testcases/kernel/syscalls/getcpu/getcpu01.c
+++ b/testcases/kernel/syscalls/getcpu/getcpu01.c
@@ -201,8 +201,7 @@
 	set = malloc(sizeof(cpu_set_t));
 #endif
 	if (set == NULL) {
-		tst_resm(TFAIL, "CPU_ALLOC:errno:%d", errno);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "CPU_ALLOC:errno:%d", errno);
 	}
 #if __GLIBC_PREREQ(2, 7)
 	size = CPU_ALLOC_SIZE(nrcpus);
@@ -237,8 +236,7 @@
 #endif
 	if (sched_setaffinity(0, size, set) < 0) {
 		CPU_FREE(set);
-		tst_resm(TFAIL, "sched_setaffinity:errno:%d", errno);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "sched_setaffinity:errno:%d", errno);
 	}
 	CPU_FREE(set);
 	return cpu_max;
diff --git a/testcases/kernel/syscalls/getrusage/getrusage03.c b/testcases/kernel/syscalls/getrusage/getrusage03.c
index 09495e4..8b0768f 100644
--- a/testcases/kernel/syscalls/getrusage/getrusage03.c
+++ b/testcases/kernel/syscalls/getrusage/getrusage03.c
@@ -349,8 +349,7 @@
 	/* Disable test if the version of the kernel is less than 2.6.32 */
 	if ((tst_kvercmp(2, 6, 32)) < 0) {
 		tst_resm(TCONF, "This ru_maxrss field is not supported");
-		tst_resm(TCONF, "before kernel 2.6.32");
-		tst_exit();
+		tst_brkm(TCONF, NULL, "before kernel 2.6.32");
 	}
 
 	tst_sig(FORK, DEF_HANDLER, cleanup);
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c
index 9d607fb..b9fd938 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl06.c
@@ -78,8 +78,7 @@
 	TEST(msgget(key, IPC_CREAT | IPC_EXCL));
 	msqid = TEST_RETURN;
 	if (TEST_RETURN == -1) {
-		tst_resm(TFAIL | TTERRNO, "msgget() failed");
-		tst_exit();
+		tst_brkm(TFAIL | TTERRNO, NULL, "msgget() failed");
 	}
 
 	TEST(msgctl(msqid, IPC_STAT, &buf));
@@ -96,25 +95,24 @@
 	 */
 
 	if (buf.msg_qnum != 0) {
-		tst_resm(TFAIL, "error: unexpected nbr of messages %ld",
+		tst_brkm(TFAIL, NULL, "error: unexpected nbr of messages %ld",
 			 buf.msg_qnum);
-		tst_exit();
 	}
 	if (buf.msg_perm.uid != getuid()) {
-		tst_resm(TFAIL, "error: unexpected uid %d", buf.msg_perm.uid);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "error: unexpected uid %d",
+			 buf.msg_perm.uid);
 	}
 	if (buf.msg_perm.gid != getgid()) {
-		tst_resm(TFAIL, "error: unexpected gid %d", buf.msg_perm.gid);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "error: unexpected gid %d",
+			 buf.msg_perm.gid);
 	}
 	if (buf.msg_perm.cuid != getuid()) {
-		tst_resm(TFAIL, "error: unexpected cuid %d", buf.msg_perm.cuid);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "error: unexpected cuid %d",
+			 buf.msg_perm.cuid);
 	}
 	if (buf.msg_perm.cgid != getgid()) {
-		tst_resm(TFAIL, "error: unexpected cgid %d", buf.msg_perm.cgid);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "error: unexpected cgid %d",
+			 buf.msg_perm.cgid);
 	}
 
 	tst_resm(TPASS, "msgctl06 ran successfully!");
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c
index 901259e..f3bb3cf 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl07.c
@@ -91,21 +91,19 @@
 
 	key = getipckey();
 	if ((msqid = msgget(key, IPC_CREAT | IPC_EXCL)) == -1) {
-		tst_resm(TFAIL | TERRNO, "msgget() failed");
-		tst_exit();
+		tst_brkm(TFAIL | TERRNO, NULL, "msgget() failed");
 
 	}
 
 	pid = FORK_OR_VFORK();
 	if (pid < 0) {
 		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "\tFork failed (may be OK if under stress)");
-		tst_exit();
+		tst_brkm(TFAIL, NULL,
+			 "\tFork failed (may be OK if under stress)");
 	} else if (pid == 0) {
 #ifdef UCLINUX
 		if (self_exec(argv[0], "ndd", 1, msqid, c1_msgp.type) < 0) {
-			tst_resm(TFAIL, "\tself_exec failed");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "\tself_exec failed");
 		}
 #else
 		do_child_1();
@@ -139,21 +137,20 @@
 		wait(&status);
 	}
 	if ((status >> 8) == 1) {
-		tst_resm(TFAIL, "test failed. status = %d", (status >> 8));
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "test failed. status = %d",
+			 (status >> 8));
 	}
 
 	pid = FORK_OR_VFORK();
 	if (pid < 0) {
 		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "\tFork failed (may be OK if under stress)");
-		tst_exit();
+		tst_brkm(TFAIL, NULL,
+			 "\tFork failed (may be OK if under stress)");
 	} else if (pid == 0) {
 #ifdef UCLINUX
 		if (self_exec(argv[0], "ndddd", 1, msqid, c1_msgp.type,
 			      c2_msgp.type, c3_msgp.type) < 0) {
-			tst_resm(TFAIL, "\tself_exec failed");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "\tself_exec failed");
 		}
 #else
 		do_child_2();
@@ -205,8 +202,8 @@
 		wait(&status);
 	}
 	if ((status >> 8) == 1) {
-		tst_resm(TFAIL, "test failed. status = %d", (status >> 8));
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "test failed. status = %d",
+			 (status >> 8));
 	}
 	/*
 	 * Remove the message queue from the system
@@ -218,8 +215,7 @@
 	(void)msgctl(msqid, IPC_RMID, NULL);
 	if ((status = msgctl(msqid, IPC_STAT, NULL)) != -1) {
 		(void)msgctl(msqid, IPC_RMID, NULL);
-		tst_resm(TFAIL, "msgctl(msqid, IPC_RMID) failed");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "msgctl(msqid, IPC_RMID) failed");
 
 	}
 
@@ -243,18 +239,16 @@
 	int size;
 
 	if ((size = msgrcv(msqid, &c1_msgp, BYTES, 0, 0)) == -1) {
-		tst_resm(TFAIL | TERRNO, "msgrcv() failed");
-		tst_exit();
+		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
 	}
 	if (size != BYTES) {
-		tst_resm(TFAIL, "error: received %d bytes expected %d", size,
+		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
+			 size,
 			 BYTES);
-		tst_exit();
 	}
 	for (i = 0; i < BYTES; i++)
 		if (c1_msgp.text[i] != 'i') {
-			tst_resm(TFAIL, "error: corrup message");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "error: corrup message");
 		}
 	exit(0);
 }
@@ -265,46 +259,40 @@
 	int size;
 
 	if ((size = msgrcv(msqid, &c3_msgp, BYTES, 3, 0)) == -1) {
-		tst_resm(TFAIL | TERRNO, "msgrcv() failed");
-		tst_exit();
+		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
 	}
 	if (size != BYTES) {
-		tst_resm(TFAIL, "error: received %d bytes expected %d", size,
+		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
+			 size,
 			 BYTES);
-		tst_exit();
 	}
 	for (k = 0; k < BYTES; k++)
 		if (c3_msgp.text[k] != 'k') {
-			tst_resm(TFAIL, "error: corrupt message");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "error: corrupt message");
 		}
 	if ((size = msgrcv(msqid, &c2_msgp, BYTES, 2, 0)) == -1) {
-		tst_resm(TFAIL | TERRNO, "msgrcv() failed");
-		tst_exit();
+		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
 	}
 	if (size != BYTES) {
-		tst_resm(TFAIL, "error: received %d bytes expected %d", size,
+		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
+			 size,
 			 BYTES);
-		tst_exit();
 	}
 	for (j = 0; j < BYTES; j++)
 		if (c2_msgp.text[j] != 'j') {
-			tst_resm(TFAIL, "error: corrupt message");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "error: corrupt message");
 		}
 	if ((size = msgrcv(msqid, &c1_msgp, BYTES, 1, 0)) == -1) {
-		tst_resm(TFAIL | TERRNO, "msgrcv() failed");
-		tst_exit();
+		tst_brkm(TFAIL | TERRNO, NULL, "msgrcv() failed");
 	}
 	if (size != BYTES) {
-		tst_resm(TFAIL, "error: received %d bytes expected %d", size,
+		tst_brkm(TFAIL, NULL, "error: received %d bytes expected %d",
+			 size,
 			 BYTES);
-		tst_exit();
 	}
 	for (i = 0; i < BYTES; i++)
 		if (c1_msgp.text[i] != 'i') {
-			tst_resm(TFAIL, "error: corrupt message");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "error: corrupt message");
 		}
 
 	exit(0);
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
index 036b3e0..df0d7e0 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl08.c
@@ -120,10 +120,10 @@
 			nprocs = atoi(argv[2]);
 		}
 	} else {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 " Usage: %s [ number of iterations  number of processes ]",
 			 argv[0]);
-		tst_exit();
 	}
 
 	srand(getpid());
@@ -135,8 +135,7 @@
 	sigemptyset(&act.sa_mask);
 	sigaddset(&act.sa_mask, SIGTERM);
 	if (sigaction(SIGTERM, &act, NULL) < 0) {
-		tst_resm(TFAIL, "Sigset SIGTERM failed");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
 	}
 	/* Set up array of unique keys for use in allocating message
 	 * queues
@@ -170,16 +169,15 @@
 	for (i = 0; i < nprocs; i++) {
 		fflush(stdout);
 		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_resm(TFAIL,
+			tst_brkm(TFAIL,
+				 NULL,
 				 "\tFork failed (may be OK if under stress)");
-			tst_exit();
 		}
 		/* Child does this */
 		if (pid == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv[0], "ndd", 1, keyarray[i], i) < 0) {
-				tst_resm(TFAIL, "\tself_exec failed");
-				tst_exit();
+				tst_brkm(TFAIL, NULL, "\tself_exec failed");
 			}
 #else
 			procstat = 1;
@@ -193,9 +191,9 @@
 	while (1) {
 		if ((wait(&status)) > 0) {
 			if (status >> 8 != 0) {
-				tst_resm(TFAIL, "Child exit status = %d",
+				tst_brkm(TFAIL, NULL,
+					 "Child exit status = %d",
 					 status >> 8);
-				tst_exit();
 			}
 			count++;
 		} else {
@@ -209,10 +207,10 @@
 	}
 	/* Make sure proper number of children exited */
 	if (count != nprocs) {
-		tst_resm(TFAIL,
+		tst_brkm(TFAIL,
+			 NULL,
 			 "Wrong number of children exited, Saw %d, Expected %d",
 			 count, nprocs);
-		tst_exit();
 	}
 
 	tst_resm(TPASS, "msgctl08 ran successfully!");
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
index f92a416..6fb3d83 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl09.c
@@ -134,10 +134,10 @@
 			nkids = atoi(argv[3]);
 		}
 	} else {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 " Usage: %s [ number of iterations  number of processes number of read/write pairs ]",
 			 argv[0]);
-		tst_exit();
 	}
 
 	procstat = 0;
@@ -146,8 +146,7 @@
 
 	/* Setup signal handleing routine */
 	if (sigset(SIGTERM, term) == SIG_ERR) {
-		tst_resm(TFAIL, "Sigset SIGTERM failed");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "Sigset SIGTERM failed");
 	}
 	/* Set up array of unique keys for use in allocating message
 	 * queues
@@ -180,16 +179,15 @@
 	for (i = 0; i < nprocs; i++) {
 		fflush(stdout);
 		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_resm(TFAIL,
+			tst_brkm(TFAIL,
+				 NULL,
 				 "\tFork failed (may be OK if under stress)");
-			tst_exit();
 		}
 		/* Child does this */
 		if (pid == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv[0], "ndd", 1, keyarray[i], i) < 0) {
-				tst_resm(TFAIL, "\tself_exec failed");
-				tst_exit();
+				tst_brkm(TFAIL, NULL, "\tself_exec failed");
 			}
 #else
 			procstat = 1;
@@ -203,9 +201,9 @@
 	while (1) {
 		if ((wait(&status)) > 0) {
 			if (status >> 8 != PASS) {
-				tst_resm(TFAIL, "Child exit status = %d",
+				tst_brkm(TFAIL, NULL,
+					 "Child exit status = %d",
 					 status >> 8);
-				tst_exit();
 			}
 			count++;
 		} else {
@@ -219,10 +217,10 @@
 	}
 	/* Make sure proper number of children exited */
 	if (count != nprocs) {
-		tst_resm(TFAIL,
+		tst_brkm(TFAIL,
+			 NULL,
 			 "Wrong number of children exited, Saw %d, Expected %d",
 			 count, nprocs);
-		tst_exit();
 	}
 
 	tst_resm(TPASS, "msgctl09 ran successfully!");
@@ -271,8 +269,7 @@
 	}
 
 	if (msgctl(tid, IPC_RMID, 0) < 0) {
-		tst_resm(TFAIL | TERRNO, "Msgctl error in cleanup");
-		tst_exit();
+		tst_brkm(TFAIL | TERRNO, NULL, "Msgctl error in cleanup");
 	}
 }
 
diff --git a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
index 977881f..9914f66 100644
--- a/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
+++ b/testcases/kernel/syscalls/ipc/msgctl/msgctl10.c
@@ -117,10 +117,10 @@
 			nprocs = atoi(argv[2]);
 		}
 	} else {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 " Usage: %s [ number of iterations  number of processes ]",
 			 argv[0]);
-		tst_exit();
 	}
 
 	srand(getpid());
@@ -166,9 +166,9 @@
 	for (i = 0; i < nprocs; i++) {
 		fflush(stdout);
 		if ((pid = FORK_OR_VFORK()) < 0) {
-			tst_resm(TFAIL,
+			tst_brkm(TFAIL,
+				 NULL,
 				 "\tFork failed (may be OK if under stress)");
-			tst_exit();
 		}
 		/* Child does this */
 		if (pid == 0) {
@@ -187,9 +187,9 @@
 	while (1) {
 		if ((wait(&status)) > 0) {
 			if (status >> 8 != 0) {
-				tst_resm(TFAIL, "Child exit status = %d",
+				tst_brkm(TFAIL, NULL,
+					 "Child exit status = %d",
 					 status >> 8);
-				tst_exit();
 			}
 			count++;
 		} else {
@@ -203,10 +203,10 @@
 	}
 	/* Make sure proper number of children exited */
 	if (count != nprocs) {
-		tst_resm(TFAIL,
+		tst_brkm(TFAIL,
+			 NULL,
 			 "Wrong number of children exited, Saw %d, Expected %d",
 			 count, nprocs);
-		tst_exit();
 	}
 
 	tst_resm(TPASS, "msgctl10 ran successfully!");
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl06.c b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
index a9cbf68..50974cb 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl06.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl06.c
@@ -215,9 +215,8 @@
 				if (asprintf(&maxsemstring, "%s%s%d",
 					     maxsemstring, (j ? ":" : ""),
 					     maxsemvals[j]) < 0) {
-					tst_resm(TBROK, "Could not serialize "
+					tst_brkm(TBROK, NULL, "Could not serialize "
 						 "maxsemvals");
-					tst_exit();
 				}
 			}
 			if (self_exec(argv0, "dS", id, maxsemstring) < 0) {
@@ -298,14 +297,12 @@
 	tok = strtok(maxsemstring, ":");
 	for (i = 0; i < NSEMS; i++) {
 		if (strlen(tok) == 0) {
-			tst_resm(TBROK, "Invalid argument to -C option");
-			tst_exit();
+			tst_brkm(TBROK, NULL, "Invalid argument to -C option");
 		}
 
 		maxsemvals[i] = strtol(tok, &endptr, 10);
 		if (*endptr != '\0') {
-			tst_resm(TBROK, "Invalid argument to -C option");
-			tst_exit();
+			tst_brkm(TBROK, NULL, "Invalid argument to -C option");
 		}
 		tok = strtok(NULL, ":");
 	}
diff --git a/testcases/kernel/syscalls/ipc/semctl/semctl07.c b/testcases/kernel/syscalls/ipc/semctl/semctl07.c
index f4c7c8b..fce5c4b 100644
--- a/testcases/kernel/syscalls/ipc/semctl/semctl07.c
+++ b/testcases/kernel/syscalls/ipc/semctl/semctl07.c
@@ -171,8 +171,7 @@
 	nsems = 1;
 
 	if ((semid = semget(key, nsems, SEM_RA | IPC_CREAT)) == -1) {
-		tst_resm(TFAIL, "semget() failed errno = %d", errno);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "semget() failed errno = %d", errno);
 	}
 }
 
diff --git a/testcases/kernel/syscalls/kill/kill12.c b/testcases/kernel/syscalls/kill/kill12.c
index 9226980..1af2359 100644
--- a/testcases/kernel/syscalls/kill/kill12.c
+++ b/testcases/kernel/syscalls/kill/kill12.c
@@ -119,9 +119,8 @@
 		if (pid == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv[0], "dd", temp, sig) < 0) {
-				tst_resm(TBROK, "self_exec FAILED - "
+				tst_brkm(TBROK, NULL, "self_exec FAILED - "
 					 "terminating test.");
-				tst_exit();
 			}
 #else
 			do_child();
@@ -267,8 +266,7 @@
 
 int forkfail(void)
 {
-	tst_resm(TBROK, "FORK FAILED - terminating test.");
-	tst_exit();
+	tst_brkm(TBROK, NULL, "FORK FAILED - terminating test.");
 }
 
 /****** ** **   *******/
diff --git a/testcases/kernel/syscalls/mkdir/mkdir09.c b/testcases/kernel/syscalls/mkdir/mkdir09.c
index 55f1849..1413c40 100644
--- a/testcases/kernel/syscalls/mkdir/mkdir09.c
+++ b/testcases/kernel/syscalls/mkdir/mkdir09.c
@@ -212,8 +212,8 @@
 
 	if ((pidlist = malloc((child_groups * NCHILD) * sizeof(int))) ==
 	    NULL) {
-		tst_resm(TWARN, "\tMalloc failed (may be OK if under stress)");
-		tst_exit();
+		tst_brkm(TWARN, NULL,
+			 "\tMalloc failed (may be OK if under stress)");
 	}
 
 	child_count = 0;
@@ -265,10 +265,10 @@
 	while (1) {
 		if ((child = wait(&status)) > 0) {
 			if (status != 0) {
-				tst_resm(TWARN,
+				tst_brkm(TWARN,
+					 NULL,
 					 "\tChild{%d} exited status = %0x",
 					 child, status);
-				tst_exit();
 			}
 			count++;
 		} else {
@@ -285,15 +285,14 @@
 
 	if (count != child_count) {
 		tst_resm(TWARN, "\tWrong number of children waited on!");
-		tst_resm(TWARN, "\tSaw %d, expected %d", count, NCHILD);
-		tst_exit();
+		tst_brkm(TWARN, NULL, "\tSaw %d, expected %d", count,
+			 NCHILD);
 	}
 
 	/* Check for core file in test directory. */
 
 	if (access("core", 0) == 0) {
-		tst_resm(TWARN, "\tCore file found in test directory.");
-		tst_exit();
+		tst_brkm(TWARN, NULL, "\tCore file found in test directory.");
 	}
 
 	/* Remove expected files */
@@ -301,10 +300,10 @@
 	for (j = 0; j < nfiles; j += NCHILD) {
 		sprintf(tmpdir, DIR_NAME, j);
 		if (rmdir(tmpdir) < 0) {
-			tst_resm(TWARN,
+			tst_brkm(TWARN,
+				 NULL,
 				 "\tError removing expected directory, ERRNO = %d",
 				 errno);
-			tst_exit();
 		}
 	}
 
@@ -373,8 +372,7 @@
 	/* Routine to handle SIGTERM signal. */
 
 	if (parent_pid == getpid()) {
-		tst_resm(TWARN, "\tsignal SIGTERM received by parent.");
-		tst_exit();
+		tst_brkm(TWARN, NULL, "\tsignal SIGTERM received by parent.");
 	}
 	sigterm++;
 	if (jump) {
diff --git a/testcases/kernel/syscalls/mlockall/mlockall03.c b/testcases/kernel/syscalls/mlockall/mlockall03.c
index 6600546..79ef3ab 100644
--- a/testcases/kernel/syscalls/mlockall/mlockall03.c
+++ b/testcases/kernel/syscalls/mlockall/mlockall03.c
@@ -121,8 +121,7 @@
 
 	/* allocate some space for buf */
 	if ((buf = malloc((size_t)sizeof(struct utsname))) == NULL) {
-		tst_resm(TFAIL, "malloc failed for buf");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "malloc failed for buf");
 	}
 
 	if (uname(buf) < 0) {
@@ -130,9 +129,9 @@
 	}
 
 	if ((compare(ref_release, buf->release)) <= 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "In Linux 2.6.8 and earlier this test will not run.");
-		tst_exit();
 	}
 
 	setup();
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
index c998003..75cb87e 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt01.c
@@ -263,9 +263,9 @@
 #elif HAVE_MODIFY_LDT
 int main(void)
 {
-	tst_resm(TCONF,
+	tst_brkm(TCONF,
+		 NULL,
 		 "modify_ldt is available but not tested on the platform than __i386__");
-	tst_exit();
 }
 
 #else
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
index 2aa03e4..0337fe6 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt02.c
@@ -236,9 +236,9 @@
 #elif HAVE_MODIFY_LDT
 int main(void)
 {
-	tst_resm(TCONF,
+	tst_brkm(TCONF,
+		 NULL,
 		 "modify_ldt is available but not tested on the platform than __i386__");
-	tst_exit();
 }
 
 #else /* if defined(__i386__) */
diff --git a/testcases/kernel/syscalls/modify_ldt/modify_ldt03.c b/testcases/kernel/syscalls/modify_ldt/modify_ldt03.c
index 50740ce..c142518 100644
--- a/testcases/kernel/syscalls/modify_ldt/modify_ldt03.c
+++ b/testcases/kernel/syscalls/modify_ldt/modify_ldt03.c
@@ -94,10 +94,9 @@
 
 int main(void)
 {
-	tst_resm(TCONF,
-		 "modify_ldt is available but not tested on the platform than "
+	tst_brkm(TCONF,
+		 NULL, "modify_ldt is available but not tested on the platform than "
 		 "__i386__");
-	tst_exit();
 }
 
 #else /* if defined(__i386__) */
diff --git a/testcases/kernel/syscalls/move_pages/move_pages11.c b/testcases/kernel/syscalls/move_pages/move_pages11.c
index 2dcb3e3..600232b 100644
--- a/testcases/kernel/syscalls/move_pages/move_pages11.c
+++ b/testcases/kernel/syscalls/move_pages/move_pages11.c
@@ -213,13 +213,12 @@
 	check_config(TEST_NODES);
 
 	if ((ltpuser = getpwnam("nobody")) == NULL) {
-		tst_resm(TBROK, "'nobody' user not present");
-		tst_exit();
+		tst_brkm(TBROK, NULL, "'nobody' user not present");
 	}
 
 	if (seteuid(ltpuser->pw_uid) == -1) {
-		tst_resm(TBROK, "setting uid to %d failed", ltpuser->pw_uid);
-		tst_exit();
+		tst_brkm(TBROK, NULL, "setting uid to %d failed",
+			 ltpuser->pw_uid);
 	}
 
 	/* Pause if that option was specified
diff --git a/testcases/kernel/syscalls/nftw/tools.c b/testcases/kernel/syscalls/nftw/tools.c
index 04a50da..b5c7dfb 100644
--- a/testcases/kernel/syscalls/nftw/tools.c
+++ b/testcases/kernel/syscalls/nftw/tools.c
@@ -264,8 +264,7 @@
  */
 void fail_exit(void)
 {
-	tst_resm(TFAIL, "Test failed");
-	tst_exit();
+	tst_brkm(TFAIL, NULL, "Test failed");
 }
 
 /**************/
diff --git a/testcases/kernel/syscalls/nftw/tools64.c b/testcases/kernel/syscalls/nftw/tools64.c
index 6e9d499..3537a73 100644
--- a/testcases/kernel/syscalls/nftw/tools64.c
+++ b/testcases/kernel/syscalls/nftw/tools64.c
@@ -264,8 +264,7 @@
  */
 void fail_exit(void)
 {
-	tst_resm(TFAIL, "Test failed");
-	tst_exit();
+	tst_brkm(TFAIL, NULL, "Test failed");
 }
 
 /**************/
diff --git a/testcases/kernel/syscalls/pipe2/pipe2_01.c b/testcases/kernel/syscalls/pipe2/pipe2_01.c
index e813f11..d4cc766 100644
--- a/testcases/kernel/syscalls/pipe2/pipe2_01.c
+++ b/testcases/kernel/syscalls/pipe2/pipe2_01.c
@@ -139,9 +139,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/pipe2/pipe2_02.c b/testcases/kernel/syscalls/pipe2/pipe2_02.c
index 5850825..09ac043 100644
--- a/testcases/kernel/syscalls/pipe2/pipe2_02.c
+++ b/testcases/kernel/syscalls/pipe2/pipe2_02.c
@@ -130,9 +130,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/ptrace/ptrace04.c b/testcases/kernel/syscalls/ptrace/ptrace04.c
index d09e671..574cb2d 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace04.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace04.c
@@ -119,8 +119,8 @@
 	tst_resm(TINFO, "After exec() in child");
 	errno = 0;
 	if (ptrace(PTRACE_SYSCALL, pid, NULL, NULL) && errno) {
-		tst_resm(TFAIL, "PTRACE_SYSCALL failed: %s", strerror(errno));
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "PTRACE_SYSCALL failed: %s",
+			 strerror(errno));
 	}
 	compare_registers(0x00);
 	compare_registers(0xff);
diff --git a/testcases/kernel/syscalls/ptrace/ptrace05.c b/testcases/kernel/syscalls/ptrace/ptrace05.c
index 7b27fa9..43c0f45 100644
--- a/testcases/kernel/syscalls/ptrace/ptrace05.c
+++ b/testcases/kernel/syscalls/ptrace/ptrace05.c
@@ -67,18 +67,18 @@
 		end_signum = (int)strtol((const char *)*(argv + 2), NULL, 10);
 		/* Parse the signal value. */
 		if (end_signum == 0 && errno != 0) {
-			tst_resm(TBROK, "argument (%s) isn't a valid number.\n",
+			tst_brkm(TBROK, NULL,
+				 "argument (%s) isn't a valid number.\n",
 				 *(argv + 2));
-			tst_exit();
 		}
 		/* FALLTHROUGH */
 	case 2:
 		start_signum = (int)strtol((const char *)*(argv + 1), NULL, 10);
 		/* Parse the signal value. */
 		if (end_signum == 0 && errno != 0) {
-			tst_resm(TBROK, "argument (%s) isn't a valid number.\n",
+			tst_brkm(TBROK, NULL,
+				 "argument (%s) isn't a valid number.\n",
 				 *(argv + 1));
-			tst_exit();
 		}
 		break;
 	case 1:
diff --git a/testcases/kernel/syscalls/pwrite/pwrite04.c b/testcases/kernel/syscalls/pwrite/pwrite04.c
index 4b3e83d..e11901d 100644
--- a/testcases/kernel/syscalls/pwrite/pwrite04.c
+++ b/testcases/kernel/syscalls/pwrite/pwrite04.c
@@ -233,8 +233,8 @@
 	for (i = 0; i < NBUFS; i++) {
 		wbuf[i] = malloc(K1);
 		if (wbuf[i] == NULL) {
-			tst_resm(TBROK, "ib: malloc failed: errno=%d", errno);
-			tst_exit();
+			tst_brkm(TBROK, NULL, "ib: malloc failed: errno=%d",
+				 errno);
 		}
 		memset(wbuf[i], i, K1);
 	}
@@ -250,9 +250,9 @@
 	off_t offloc;
 
 	if ((offloc = lseek(fdesc, offset, whence)) != checkoff) {
-		tst_resm(TFAIL, "(%ld = lseek(%d, %ld, %d)) != %ld) errno = %d",
+		tst_brkm(TFAIL, NULL,
+			 "(%ld = lseek(%d, %ld, %d)) != %ld) errno = %d",
 			 offloc, fdesc, offset, whence, checkoff, errno);
-		tst_exit();
 	}
 }
 
diff --git a/testcases/kernel/syscalls/quotactl/quotactl01.c b/testcases/kernel/syscalls/quotactl/quotactl01.c
index 28774a0..5810db7 100644
--- a/testcases/kernel/syscalls/quotactl/quotactl01.c
+++ b/testcases/kernel/syscalls/quotactl/quotactl01.c
@@ -189,8 +189,7 @@
 #ifdef BROKEN_QUOTACTL
 int main(void)
 {
-	tst_resm(TBROK, "This system doesn't support quota v2");
-	tst_exit();
+	tst_brkm(TBROK, NULL, "This system doesn't support quota v2");
 }
 #else
 int cmd[] = {
diff --git a/testcases/kernel/syscalls/rename/rename14.c b/testcases/kernel/syscalls/rename/rename14.c
index 1aab157..5f119f2 100644
--- a/testcases/kernel/syscalls/rename/rename14.c
+++ b/testcases/kernel/syscalls/rename/rename14.c
@@ -85,8 +85,7 @@
 	act.sa_mask = set;
 	act.sa_flags = 0;
 	if (sigaction(SIGTERM, &act, &oact)) {
-		tst_resm(TBROK, "Sigaction(SIGTERM)");
-		tst_exit();
+		tst_brkm(TBROK, NULL, "Sigaction(SIGTERM)");
 	}
 
 	sigemptyset(&set);
@@ -94,8 +93,7 @@
 	act.sa_mask = set;
 	act.sa_flags = 0;
 	if (sigaction(SIGALRM, &act, 0)) {
-		tst_resm(TBROK, "Sigaction(SIGALRM)");
-		tst_exit();
+		tst_brkm(TBROK, NULL, "Sigaction(SIGALRM)");
 	}
 	parent_pid = getpid();
 	tst_tmpdir();
@@ -103,8 +101,7 @@
 
 	pid = FORK_OR_VFORK();
 	if (pid < 0) {
-		tst_resm(TBROK, "fork() returned %d", pid);
-		tst_exit();
+		tst_brkm(TBROK, NULL, "fork() returned %d", pid);
 	}
 	if (pid == 0) {
 #ifdef UCLINUX
@@ -120,8 +117,7 @@
 	if (pid < 0) {
 		(void)kill(kidpid[0], SIGTERM);
 		(void)unlink("./rename14");
-		tst_resm(TBROK, "fork() returned %d", pid);
-		tst_exit();
+		tst_brkm(TBROK, NULL, "fork() returned %d", pid);
 	}
 	if (pid == 0) {
 #ifdef UCLINUX
diff --git a/testcases/kernel/syscalls/sendfile/sendfile08.c b/testcases/kernel/syscalls/sendfile/sendfile08.c
index ab886c1..a10fa56 100644
--- a/testcases/kernel/syscalls/sendfile/sendfile08.c
+++ b/testcases/kernel/syscalls/sendfile/sendfile08.c
@@ -99,8 +99,7 @@
 	/* Disable test if the version of the kernel is less than 2.6.33 */
 	if ((tst_kvercmp(2, 6, 33)) < 0) {
 		tst_resm(TCONF, "The out_fd must be socket before kernel");
-		tst_resm(TCONF, "2.6.33, see kernel commit cc56f7d");
-		tst_exit();
+		tst_brkm(TCONF, NULL, "2.6.33, see kernel commit cc56f7d");
 	}
 
 	TEST_PAUSE;
diff --git a/testcases/kernel/syscalls/setsid/setsid01.c b/testcases/kernel/syscalls/setsid/setsid01.c
index eee6edb..9e62da3 100644
--- a/testcases/kernel/syscalls/setsid/setsid01.c
+++ b/testcases/kernel/syscalls/setsid/setsid01.c
@@ -165,14 +165,12 @@
 	}
 
 	if ((pid = FORK_OR_VFORK()) == -1) {
-		tst_resm(TFAIL, "Fork failed");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "Fork failed");
 	}
 	if (pid == 0) {
 #ifdef UCLINUX
 		if (self_exec(argv0, "n", 2) < 0) {
-			tst_resm(TFAIL, "self_exec failed");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "self_exec failed");
 		}
 #else
 		do_child_2();
diff --git a/testcases/kernel/syscalls/signalfd/signalfd01.c b/testcases/kernel/syscalls/signalfd/signalfd01.c
index f9b5669..b12fafc 100644
--- a/testcases/kernel/syscalls/signalfd/signalfd01.c
+++ b/testcases/kernel/syscalls/signalfd/signalfd01.c
@@ -79,8 +79,7 @@
 #ifdef USE_STUB
 int main(int argc, char **argv)
 {
-	tst_resm(TCONF, "System doesn't support execution of the test");
-	tst_exit();
+	tst_brkm(TCONF, NULL, "System doesn't support execution of the test");
 }
 
 #else
diff --git a/testcases/kernel/syscalls/signalfd4/signalfd4_01.c b/testcases/kernel/syscalls/signalfd4/signalfd4_01.c
index 7d29649..75b0e4e 100644
--- a/testcases/kernel/syscalls/signalfd4/signalfd4_01.c
+++ b/testcases/kernel/syscalls/signalfd4/signalfd4_01.c
@@ -137,9 +137,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/signalfd4/signalfd4_02.c b/testcases/kernel/syscalls/signalfd4/signalfd4_02.c
index ff75d0b..2347338 100644
--- a/testcases/kernel/syscalls/signalfd4/signalfd4_02.c
+++ b/testcases/kernel/syscalls/signalfd4/signalfd4_02.c
@@ -132,9 +132,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/socket/socket02.c b/testcases/kernel/syscalls/socket/socket02.c
index 87f6b04..1149691 100644
--- a/testcases/kernel/syscalls/socket/socket02.c
+++ b/testcases/kernel/syscalls/socket/socket02.c
@@ -140,9 +140,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/socket/socket03.c b/testcases/kernel/syscalls/socket/socket03.c
index 56696b8..fe96a6b 100644
--- a/testcases/kernel/syscalls/socket/socket03.c
+++ b/testcases/kernel/syscalls/socket/socket03.c
@@ -127,9 +127,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/splice/splice02.c b/testcases/kernel/syscalls/splice/splice02.c
index ab5b11d..ee7798b 100644
--- a/testcases/kernel/syscalls/splice/splice02.c
+++ b/testcases/kernel/syscalls/splice/splice02.c
@@ -72,8 +72,8 @@
 	setup();
 
 	if (ac < 2) {
-		tst_resm(TFAIL, "%s failed - Usage: %s outfile", TCID, av[0]);
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "%s failed - Usage: %s outfile", TCID,
+			 av[0]);
 	}
 
 	fd = SAFE_OPEN(cleanup, av[1], O_WRONLY | O_CREAT | O_TRUNC, 0644);
diff --git a/testcases/kernel/syscalls/switch/endian_switch01.c b/testcases/kernel/syscalls/switch/endian_switch01.c
index 8ca003d..a71ef29 100644
--- a/testcases/kernel/syscalls/switch/endian_switch01.c
+++ b/testcases/kernel/syscalls/switch/endian_switch01.c
@@ -116,9 +116,9 @@
 {
 
 	if ((tst_kvercmp(2, 6, 26)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.26 and higher");
-		tst_exit();
 	}
 	setup();
 	for (; *auxv != AT_NULL && *auxv != AT_HWCAP; auxv += 2) ;
@@ -130,8 +130,7 @@
 	if (sigsetjmp(jb, 1) == 0)
 		do_le_switch();
 	if (got_sigill) {
-		tst_resm(TFAIL, "Got SIGILL - test failed");
-		tst_exit();
+		tst_brkm(TFAIL, NULL, "Got SIGILL - test failed");
 	}
 	tst_resm(TPASS, "endian_switch() syscall tests passed");
 	tst_exit();
diff --git a/testcases/kernel/syscalls/sysctl/sysctl01.c b/testcases/kernel/syscalls/sysctl/sysctl01.c
index aec4c52..9cfd169 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl01.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl01.c
@@ -200,7 +200,7 @@
 int main(void)
 {
 
-	tst_resm(TCONF, "This test needs a kernel that has sysctl syscall.");
-	tst_exit();
+	tst_brkm(TCONF, NULL,
+		 "This test needs a kernel that has sysctl syscall.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/sysctl/sysctl03.c b/testcases/kernel/syscalls/sysctl/sysctl03.c
index bdec288..cb71ff9 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl03.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl03.c
@@ -224,7 +224,7 @@
 int main(void)
 {
 
-	tst_resm(TCONF, "This test needs a kernel that has sysctl syscall.");
-	tst_exit();
+	tst_brkm(TCONF, NULL,
+		 "This test needs a kernel that has sysctl syscall.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/sysctl/sysctl04.c b/testcases/kernel/syscalls/sysctl/sysctl04.c
index a8b067c..08d25b6 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl04.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl04.c
@@ -177,7 +177,7 @@
 int main(void)
 {
 
-	tst_resm(TCONF, "This test needs a kernel that has sysctl syscall.");
-	tst_exit();
+	tst_brkm(TCONF, NULL,
+		 "This test needs a kernel that has sysctl syscall.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/sysctl/sysctl05.c b/testcases/kernel/syscalls/sysctl/sysctl05.c
index 9cc7169..4036b50 100644
--- a/testcases/kernel/syscalls/sysctl/sysctl05.c
+++ b/testcases/kernel/syscalls/sysctl/sysctl05.c
@@ -204,7 +204,7 @@
 int main(void)
 {
 
-	tst_resm(TCONF, "This test needs a kernel that has sysctl syscall.");
-	tst_exit();
+	tst_brkm(TCONF, NULL,
+		 "This test needs a kernel that has sysctl syscall.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/syslog/syslogtst.c b/testcases/kernel/syscalls/syslog/syslogtst.c
index 0935503..b976698 100644
--- a/testcases/kernel/syscalls/syslog/syslogtst.c
+++ b/testcases/kernel/syscalls/syslog/syslogtst.c
@@ -169,9 +169,9 @@
 #endif
 			flag3 = 1;
 		} else {
-			tst_resm(TFAIL,
+			tst_brkm(TFAIL,
+				 NULL,
 				 "Cannot move /var/log/messages. Setup failed...exiting...");
-			tst_exit();
 		}
 		sleep(10);
 
@@ -190,9 +190,9 @@
 			status = 0;
 #endif
 			if (status != 0) {
-				tst_resm(TFAIL,
-					 "Restoring /var/log/messages failed...");
-				tst_exit();
+				tst_brkm(TFAIL,
+					 NULL,
+				         "Restoring /var/log/messages failed...");
 			}
 #ifdef DEBUG
 			else
diff --git a/testcases/kernel/syscalls/timerfd/timerfd01.c b/testcases/kernel/syscalls/timerfd/timerfd01.c
index 96c0bb7..02d2efe 100644
--- a/testcases/kernel/syscalls/timerfd/timerfd01.c
+++ b/testcases/kernel/syscalls/timerfd/timerfd01.c
@@ -274,7 +274,7 @@
 int main(void)
 {
 
-	tst_resm(TCONF, "This test needs a kernel that has timerfd syscall.");
-	tst_exit();
+	tst_brkm(TCONF, NULL,
+		 "This test needs a kernel that has timerfd syscall.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/timerfd/timerfd02.c b/testcases/kernel/syscalls/timerfd/timerfd02.c
index 56f2e3d..b09a424 100644
--- a/testcases/kernel/syscalls/timerfd/timerfd02.c
+++ b/testcases/kernel/syscalls/timerfd/timerfd02.c
@@ -135,9 +135,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/timerfd/timerfd03.c b/testcases/kernel/syscalls/timerfd/timerfd03.c
index d1ad676..3960d50 100644
--- a/testcases/kernel/syscalls/timerfd/timerfd03.c
+++ b/testcases/kernel/syscalls/timerfd/timerfd03.c
@@ -131,9 +131,9 @@
 		tst_brkm(TBROK, NULL, "OPTION PARSING ERROR - %s", msg);
 	}
 	if ((tst_kvercmp(2, 6, 27)) < 0) {
-		tst_resm(TCONF,
+		tst_brkm(TCONF,
+			 NULL,
 			 "This test can only run on kernels that are 2.6.27 and higher");
-		tst_exit();
 	}
 	setup();
 
diff --git a/testcases/kernel/syscalls/umount/umount01.c b/testcases/kernel/syscalls/umount/umount01.c
index 7c2213d..763547d 100644
--- a/testcases/kernel/syscalls/umount/umount01.c
+++ b/testcases/kernel/syscalls/umount/umount01.c
@@ -63,12 +63,10 @@
 			TEST(umount(mntpoint));
 			if (TEST_RETURN != 0) {
 				TEST_ERROR_LOG(TEST_ERRNO);
-				tst_resm(TFAIL, "umount(2) Failed while "
+				tst_brkm(TFAIL, NULL, "umount(2) Failed while "
 					 " unmounting %s errno = %d : %s",
 					 mntpoint, TEST_ERRNO,
 					 strerror(TEST_ERRNO));
-				/* Exit here, otherwise subsequent test fails */
-				tst_exit();
 			} else {
 				tst_resm(TPASS, "umount(2) Passed ");
 			}
diff --git a/testcases/kernel/syscalls/unshare/unshare01.c b/testcases/kernel/syscalls/unshare/unshare01.c
index 16b0a76..bfc3c95 100644
--- a/testcases/kernel/syscalls/unshare/unshare01.c
+++ b/testcases/kernel/syscalls/unshare/unshare01.c
@@ -293,7 +293,6 @@
 #else
 int main(void)
 {
-	tst_resm(TCONF, "unshare is undefined.");
-	tst_exit();
+	tst_brkm(TCONF, NULL, "unshare is undefined.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/unshare/unshare02.c b/testcases/kernel/syscalls/unshare/unshare02.c
index 5a71165..47e0d1d 100644
--- a/testcases/kernel/syscalls/unshare/unshare02.c
+++ b/testcases/kernel/syscalls/unshare/unshare02.c
@@ -220,7 +220,6 @@
 #else
 int main(void)
 {
-	tst_resm(TCONF, "unshare is undefined.");
-	tst_exit();
+	tst_brkm(TCONF, NULL, "unshare is undefined.");
 }
 #endif
diff --git a/testcases/kernel/syscalls/waitid/waitid01.c b/testcases/kernel/syscalls/waitid/waitid01.c
index 9fda13a..551d12c 100644
--- a/testcases/kernel/syscalls/waitid/waitid01.c
+++ b/testcases/kernel/syscalls/waitid/waitid01.c
@@ -140,9 +140,9 @@
 			} else {
 				TEST(waitid(P_ALL, getpid(), &infop, WEXITED));
 				if (TEST_RETURN == -1) {
-					tst_resm(TFAIL | TTERRNO,
+					tst_brkm(TFAIL | TTERRNO,
+						 NULL,
 						 "waitid(getpid()) failed");
-					tst_exit();
 				} else
 					display_status(&infop);	//CLD_EXITED = 1
 			}
@@ -155,9 +155,8 @@
 			} else {
 				TEST(waitid(P_ALL, 0, &infop, WEXITED));
 				if (TEST_RETURN == -1) {
-					tst_resm(TFAIL | TTERRNO,
-						 "waitid(0) failed");
-					tst_exit();
+					tst_brkm(TFAIL | TTERRNO,
+						 NULL, "waitid(0) failed");
 				} else
 					display_status(&infop);	//CLD_DUMPED = 3 ; SIGFPE = 8
 			}
@@ -170,8 +169,8 @@
 			TEST(kill(pid, SIGHUP));
 			TEST(waitid(P_ALL, 0, &infop, WEXITED));
 			if (TEST_RETURN == -1) {
-				tst_resm(TFAIL | TTERRNO, "waitid(0) failed");
-				tst_exit();
+				tst_brkm(TFAIL | TTERRNO, NULL,
+					 "waitid(0) failed");
 			} else
 				display_status(&infop);	//CLD_KILLED = 2 ; SIGHUP = 1
 		}
diff --git a/testcases/kernel/syscalls/waitpid/waitpid07.c b/testcases/kernel/syscalls/waitpid/waitpid07.c
index 60854b9..ad7d620 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid07.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid07.c
@@ -179,9 +179,8 @@
 		}
 
 		if (ret_val < 0) {
-			tst_resm(TFAIL, "Fork kid %d failed. "
+			tst_brkm(TFAIL, NULL, "Fork kid %d failed. "
 				 "errno = %d", kid_count, errno);
-			tst_exit();
 		}
 
 		/* parent */
@@ -207,9 +206,8 @@
 	 */
 	for (i = 0; i < MAXKIDS; i++) {
 		if (kill(fork_kid_pid[i], SIGINT) < 0) {
-			tst_resm(TFAIL, "Kill of child %d "
+			tst_brkm(TFAIL, NULL, "Kill of child %d "
 				 "failed, errno = %d", i, errno);
-			tst_exit();
 		}
 	}
 
diff --git a/testcases/kernel/syscalls/waitpid/waitpid08.c b/testcases/kernel/syscalls/waitpid/waitpid08.c
index 7408064..ce6149c 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid08.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid08.c
@@ -208,9 +208,8 @@
 	 */
 	for (i = 0; i < MAXKIDS; i++) {
 		if (kill(fork_kid_pid[i], SIGINT) < 0) {
-			tst_resm(TFAIL, "Kill of child %d "
+			tst_brkm(TFAIL, NULL, "Kill of child %d "
 				 "failed, errno = %d", i, errno);
-			tst_exit();
 		}
 	}
 
diff --git a/testcases/kernel/syscalls/waitpid/waitpid10.c b/testcases/kernel/syscalls/waitpid/waitpid10.c
index 5570b64..4beda37 100644
--- a/testcases/kernel/syscalls/waitpid/waitpid10.c
+++ b/testcases/kernel/syscalls/waitpid/waitpid10.c
@@ -467,14 +467,13 @@
 	for (i = 0; i < 50; i++) {
 		fork_pid = FORK_OR_VFORK();
 		if (fork_pid < 0) {
-			tst_resm(TFAIL, "Fork failed");
-			tst_exit();
+			tst_brkm(TFAIL, NULL, "Fork failed");
 		}
 		if (fork_pid == 0) {
 #ifdef UCLINUX
 			if (self_exec(argv0, "n", 5) < 0) {
-				tst_resm(TFAIL, "do_fork self_exec failed");
-				tst_exit();
+				tst_brkm(TFAIL, NULL,
+					 "do_fork self_exec failed");
 			}
 #else
 			do_mkdir();