summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/store.c
diff options
context:
space:
mode:
authorNiels de Vos <ndevos@redhat.com>2014-11-08 09:47:10 +0100
committerVijay Bellur <vbellur@redhat.com>2014-11-11 02:50:39 -0800
commit98f82412986339626bcd1218ff1da0fbb2664d6d (patch)
tree0c0ea8a16fc03d5bff417c9d412761628a0b2756 /libglusterfs/src/store.c
parentb3ce1bfeaab08cdf51cccd60d6d7047c692f73a9 (diff)
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 <ndevos@redhat.com> Reviewed-on: http://review.gluster.org/9078 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'libglusterfs/src/store.c')
-rw-r--r--libglusterfs/src/store.c7
1 files changed, 6 insertions, 1 deletions
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);
}