[LTP] [COMMITTED] [PATCH 02/13] Make use of SAFE_DUP()

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


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

diff --git a/testcases/kernel/syscalls/fanotify/fanotify03.c b/testcases/kernel/syscalls/fanotify/fanotify03.c
index 1ab879843..ea5c02a7b 100644
--- a/testcases/kernel/syscalls/fanotify/fanotify03.c
+++ b/testcases/kernel/syscalls/fanotify/fanotify03.c
@@ -154,10 +154,7 @@ void test01(void)
 	int ret, len = 0, i = 0, test_num = 0;
 
 	if (fd_notify_backup == -1) {
-		fd_notify_backup = dup(fd_notify);
-		if (fd_notify_backup < 0)
-			tst_brk(TBROK | TERRNO,
-				 "dup(%d) failed", fd_notify);
+		fd_notify_backup = SAFE_DUP(fd_notify);
 	}
 	run_child();
 
-- 
2.13.5



More information about the ltp mailing list