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>
This commit is contained in:
parent
b3ce1bfeaa
commit
98f8241298
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user