From 98f82412986339626bcd1218ff1da0fbb2664d6d Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Sat, 8 Nov 2014 09:47:10 +0100 Subject: store: fix compile warning in gf_store_unlock() The following warning is logged when building on Fedora 20: store.c:712:15: warning: ignoring return value of 'lockf', declared with attribute warn_unused_result [-Wunused-result] It does not really matter if unlocking fails, close() will release the lock in any case. But, log the error in case close() can not finish and hangs indefinitely (is that possible?). Change-Id: If6c832f9aec10da6c1adb761b13b58e22d38a065 BUG: 1009076 Signed-off-by: Niels de Vos Reviewed-on: http://review.gluster.org/9078 Tested-by: Gluster Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Krishnan Parthasarathi Reviewed-by: Vijay Bellur --- libglusterfs/src/store.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/store.c b/libglusterfs/src/store.c index d6a64d2cdd3..d77b38be0ab 100644 --- a/libglusterfs/src/store.c +++ b/libglusterfs/src/store.c @@ -709,7 +709,12 @@ gf_store_unlock (gf_store_handle_t *sh) GF_ASSERT (sh->locked == F_LOCK); sh->locked = F_ULOCK; - lockf (sh->fd, F_ULOCK, 0); + + /* does not matter if this fails, locks are released on close anyway */ + if (lockf (sh->fd, F_ULOCK, 0) == -1) + gf_log ("", GF_LOG_ERROR, "Failed to release lock on '%s': %s", + sh->path, strerror (errno)); + close (sh->fd); } -- cgit