[LTP] [COMMITTED] [PATCH 28/40] Make use of SAFE_FCNTL()

Cyril Hrubis chrubis@suse.cz
Tue Oct 3 16:20:01 CEST 2017


Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/syscalls/fcntl/fcntl34.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/testcases/kernel/syscalls/fcntl/fcntl34.c b/testcases/kernel/syscalls/fcntl/fcntl34.c
index c778db086..aa29cf9ea 100644
--- a/testcases/kernel/syscalls/fcntl/fcntl34.c
+++ b/testcases/kernel/syscalls/fcntl/fcntl34.c
@@ -76,15 +76,13 @@ void *thread_fn_01(void *arg)
 
 	for (i = 0; i < writes_num; ++i) {
 		lck.l_type = F_WRLCK;
-		if (fcntl(fd, F_OFD_SETLKW, &lck) == -1)
-			tst_brk(TBROK | TERRNO, "fcntl() failed");
+		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
 
 		SAFE_LSEEK(fd, 0, SEEK_END);
 		SAFE_WRITE(1, fd, buf, write_size);
 
 		lck.l_type = F_UNLCK;
-		if (fcntl(fd, F_OFD_SETLKW, &lck) == -1)
-			tst_brk(TBROK | TERRNO, "fcntl() failed");
+		SAFE_FCNTL(fd, F_OFD_SETLKW, &lck);
 
 		sched_yield();
 	}
-- 
2.13.5



More information about the ltp mailing list