STABLE2 - rgmanager: unbreak locking in clulib

Fabio M. Di Nitto fabbione@fedoraproject.org
Mon Aug 11 11:26:00 GMT 2008


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=65ce950ec30018a5d08fcb74ae8d933942ee9237
Commit:        65ce950ec30018a5d08fcb74ae8d933942ee9237
Parent:        a64697b2ae09f196e016f0ab7bdf592cbdfcd852
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:36:07 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;



More information about the Cluster-cvs mailing list