From: Martin Schwenke Date: Wed, 29 May 2019 09:11:51 +0000 (+1000) Subject: ctdb-utils: Fix CID 1125558 (Unchecked return value from library) X-Git-Tag: ldb-2.0.5~464 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=952437b1bdbe000c217836c4ecd59406e92146d7;p=thirdparty%2Fsamba.git 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 --- 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) {