This is the mail archive of the
cluster-cvs@sourceware.org
mailing list for the cluster.
master - rgmanager: unbreak locking in clulib
- From: "Fabio M. Di Nitto" <fabbione at fedoraproject dot org>
- To: cluster-cvs-relay at redhat dot com
- Date: Mon, 11 Aug 2008 07:34:49 +0000 (UTC)
- Subject: master - rgmanager: unbreak locking in clulib
Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=a7e3cf012418c46cd3f55896512dbfd5e2d0a08c
Commit: a7e3cf012418c46cd3f55896512dbfd5e2d0a08c
Parent: 4effc0bac4b5a0f627d57c974a2a936faa90eece
Author: Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate: Mon Aug 11 09:33:09 2008 +0200
Committer: Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Mon Aug 11 09:33:09 2008 +0200
rgmanager: unbreak locking in clulib
commit 1edb73bd098500d459c16797da2377a59f1ef180 introduced a set of
checks for read/write operations.
the error checks in cman.c where wrong and caused endless loops in
rgmanager startup.
fix those checks by making them "dumb" since we don't really care
about the result of the operation directly, but other bits of code
will take care of those.
Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
rgmanager/src/clulib/cman.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/rgmanager/src/clulib/cman.c b/rgmanager/src/clulib/cman.c
index 4e18aa8..1d15d3e 100644
--- a/rgmanager/src/clulib/cman.c
+++ b/rgmanager/src/clulib/cman.c
@@ -45,6 +45,7 @@ _set_nonblock(int fd)
cman_handle_t
cman_lock(int block, int preempt)
{
+ int err;
pthread_t tid;
cman_handle_t *ret = NULL;
@@ -68,8 +69,7 @@ cman_lock(int block, int preempt)
/* Try to wake up the holder! */
if (preempt)
- if(write(_wakeup_pipe[1], "!", 1) < 0)
- goto out_unlock;
+ err = write(_wakeup_pipe[1], "!", 1); /** XXX we don't care about errors here **/
/* Blocking call; do the cond-thing */
pthread_cond_wait(&_chandle_cond, &_chandle_lock);
@@ -145,6 +145,7 @@ out_unlock:
int
cman_unlock(cman_handle_t ch)
{
+ int err;
int ret = -1;
char c;
@@ -166,8 +167,7 @@ cman_unlock(cman_handle_t ch)
/* Empty wakeup pipe if we took it with the preempt flag */
if (_chandle_preempt)
- if(read(_wakeup_pipe[0], &c, 1) < 0)
- goto out_unlock;
+ err = read(_wakeup_pipe[0], &c, 1); /** XXX we don't care about errors here **/
_chandle_preempt = 0;
_chandle_holder = 0;