From 952437b1bdbe000c217836c4ecd59406e92146d7 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Wed, 29 May 2019 19:11:51 +1000 Subject: [PATCH] ctdb-utils: Fix CID 1125558 (Unchecked return value from library) Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs Autobuild-User(master): Amitay Isaacs Autobuild-Date(master): Wed Jun 5 12:09:56 UTC 2019 on sn-devel-184 --- ctdb/utils/ping_pong/ping_pong.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ctdb/utils/ping_pong/ping_pong.c b/ctdb/utils/ping_pong/ping_pong.c index 1f2bad5516b..2b337faaf55 100644 --- a/ctdb/utils/ping_pong/ping_pong.c +++ b/ctdb/utils/ping_pong/ping_pong.c @@ -150,7 +150,13 @@ static void ping_pong(int fd, int num_locks) start_timer(); - lock_range(fd, 0, 1, true); + ret = lock_range(fd, 0, 1, true); + if (ret != 0) { + printf("initial lock at 0 failed! - %s\n", strerror(errno)); + free(val); + return; + } + i = 0; while (1) { -- 2.34.1