diff libfdcore/peers.c @ 691:78b665400097

Cleanup all pthread_cleanup_push / pop pairs so that pop is always called after push, or ASSERT(0) is some grave errors
author Sebastien Decugis <sdecugis@nict.go.jp>
date Thu, 20 Jan 2011 19:44:27 +0900
parents 8c3dc8584dab
children 4ffbc9f1e922
line wrap: on
line diff
--- a/libfdcore/peers.c	Thu Jan 20 15:38:12 2011 +0900
+++ b/libfdcore/peers.c	Thu Jan 20 19:44:27 2011 +0900
@@ -532,8 +532,10 @@
 	for (v = validators.next; v != &validators; v = v->next) {
 		int auth = 0;
 		pthread_cleanup_push(fd_cleanup_rwlock, &validators_rw);
-		CHECK_FCT_DO( ret = ((int(*)(struct peer_info *, int *, int (**)(struct peer_info *)))(v->o)) (&peer->p_hdr.info, &auth, &peer->p_cb2), goto out );
+		CHECK_FCT_DO( ret = ((int(*)(struct peer_info *, int *, int (**)(struct peer_info *)))(v->o)) (&peer->p_hdr.info, &auth, &peer->p_cb2),  );
 		pthread_cleanup_pop(0);
+		if (ret)
+			goto out;
 		if (auth) {
 			ret = (auth > 0) ? 0 : -1;
 			goto out;
"Welcome to our mercurial repository"