[LTP] [COMMITTED] [PATCH 06/13] Make use of SAFE_LINK()

Cyril Hrubis chrubis@suse.cz
Tue Oct 3 17:40:53 CEST 2017


Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/open/open11.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/open/open11.c b/testcases/kernel/syscalls/open/open11.c
index 6fa21b0bd..b8cf7eb14 100644
--- a/testcases/kernel/syscalls/open/open11.c
+++ b/testcases/kernel/syscalls/open/open11.c
@@ -384,10 +384,7 @@ static void setup(void)
 	fd = SAFE_CREAT(cleanup, T_REG_EMPTY, 0644);
 	close(fd);
 
-	ret = link(T_REG, T_LINK_REG);
-	if (ret == -1)
-		tst_brkm(TBROK | TERRNO, cleanup, "Hard link %s -> %s failed",
-			 T_REG, T_LINK_REG);
+	ret = SAFE_LINK(cleanup, T_REG, T_LINK_REG);
 
 	ret = symlink(T_REG, T_SYMLINK_REG);
 	if (ret == -1)
-- 
2.13.5



More information about the ltp mailing list