Skip to contentSkip to conversation

syscalls/creat06: Fix the use of tst_brk() in cleanup

PATCH New Guangwen Feng 2 participants 2 messages Nov 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/creat06: Fix the use of tst_brk() in cleanup

Calling tst_brk() from the test cleanup would cause infinite loop and segfault, we should call tst_res(TWARN) instead, and the tst_umount() calls tst_res(TWARN) already, so we just use the tst_umount() here.

---
 testcases/kernel/syscalls/creat/creat06.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
testcases/kernel/syscalls/creat/creat06.c +2 -4
index 9c60fd0..73913cd 100644
@@ -172,10 +172,8 @@ static void test6_cleanup(void)
 
 static void cleanup(void)
 {
-	if (mount_flag && tst_umount("mntpoint") < 0) {
-		tst_brk(TBROK | TERRNO, "umount device:%s failed",
-			tst_device->dev);
-	}
+	if (mount_flag)
+		tst_umount("mntpoint");
 }
 
 static struct tst_test test = {
Signature · 1 line
1.8.4.2