[Cluster-devel] cluster/group/daemon Makefile app.c cpg.c gd_i ...

teigland at sourceware.org teigland at sourceware.org
Wed Jun 21 20:43:57 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	teigland at sourceware.org	2006-06-21 20:43:54

Modified files:
	group/daemon   : Makefile app.c cpg.c gd_internal.h joinleave.c 
	                 main.c 

Log message:
	need to include ../make/defines.mk to get {sbindir} definition
	this added -Wall which I didn't notice was missing before, so this
	uncovered a bunch of warnings that are now fixed

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/Makefile.diff?cvsroot=cluster&r1=1.10&r2=1.11
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/app.c.diff?cvsroot=cluster&r1=1.30&r2=1.31
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/cpg.c.diff?cvsroot=cluster&r1=1.25&r2=1.26
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/gd_internal.h.diff?cvsroot=cluster&r1=1.33&r2=1.34
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/joinleave.c.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/group/daemon/main.c.diff?cvsroot=cluster&r1=1.36&r2=1.37

--- cluster/group/daemon/Makefile	2006/06/12 22:55:38	1.10
+++ cluster/group/daemon/Makefile	2006/06/21 20:43:54	1.11
@@ -10,6 +10,10 @@
 ###############################################################################
 ###############################################################################
 
+top_srcdir=..
+include ${top_srcdir}/make/defines.mk
+UNINSTALL=${top_srcdir}/scripts/uninstall.pl
+
 CFLAGS+= -g -I. -I../include/ -I../../cman/lib/ -I../lib/ -I../../cman/daemon/openais/trunk/include/
 
 TARGET=groupd
@@ -46,3 +50,6 @@
 install: groupd
 	install groupd ${sbindir}
 
+uninstall:
+	${UNINSTALL} groupd ${sbindir}
+
--- cluster/group/daemon/app.c	2006/06/21 18:10:23	1.30
+++ cluster/group/daemon/app.c	2006/06/21 20:43:54	1.31
@@ -306,12 +306,19 @@
 		if (rs->cman_update)
 			continue;
 		log_debug("no cman update for recovery_set %d quorate %d",
-			  rs->nodeid, cman_quorate, cman_quorate);
+			  rs->nodeid, cman_quorate);
 		return 0;
 	}
 	return 1;
 }
 
+int is_recovery_event(event_t *ev)
+{
+	if (event_id_to_type(ev->id) == 3)
+		return 1;
+	return 0;
+}
+
 /* all groups referenced by a recovery set have been stopped on all nodes,
    and stopped for recovery */
 
@@ -713,6 +720,7 @@
 	}
 }
 
+#if 0
 static int count_nodes_not_stopped(app_t *a)
 {
 	node_t *node;
@@ -724,6 +732,7 @@
 	}
 	return i;
 }
+#endif
 
 int event_state_stopping(app_t *a)
 {
@@ -764,10 +773,10 @@
 static int process_current_event(group_t *g)
 {
 	app_t *a = g->app;
-	event_t *ev = a->current_event, *ev_tmp, *ev_safe;
+	event_t *ev = a->current_event;
 	node_t *node, *n;
 	struct nodeid *id;
-	int rv = 0, do_start = 0, count;
+	int rv = 0, do_start = 0;
 
 	if (!(event_state_stopping(a) || event_state_starting(a)))
 		log_group(g, "process_current_event %llx %d %s",
@@ -1020,7 +1029,7 @@
 	node_t *node;
 
 	if (!event_state_starting(a)) {
-		log_error(a->g, "mark_node_started: event not starting %d ",
+		log_error(a->g, "mark_node_started: event not starting %d "
 			  "from %d", a->current_event->state, nodeid);
 		return -1;
 	}
@@ -1128,7 +1137,7 @@
 	return rv;
 }
 
-static int deliver_app_messages(group_t *g)
+static void deliver_app_messages(group_t *g)
 {
 	app_t *a = g->app;
 	struct save_msg *save, *tmp;
@@ -1160,6 +1169,7 @@
 	return NULL;
 }
 
+#if 0
 static int group_started(event_t *ev)
 {
 	switch (ev->state) {
@@ -1177,6 +1187,7 @@
 		return 1;
 	};
 }
+#endif
 
 void dump_group(group_t *g)
 {
@@ -1189,7 +1200,7 @@
 	printf("name: %s\n", g->name);
 	printf("level: %d\n", g->level);
 	printf("global_id: %u\n", g->global_id);
-	printf("cpg handle: %x\n", g->cpg_handle);
+	printf("cpg handle: %llx\n", g->cpg_handle);
 	printf("cpg client: %d\n", g->cpg_client);
 	printf("app client: %d\n", g->app->client);
 
@@ -1228,13 +1239,6 @@
 		dump_group(g);
 }
 
-int is_recovery_event(event_t *ev)
-{
-	if (event_id_to_type(ev->id) == 3)
-		return 1;
-	return 0;
-}
-
 /* handle a node failure while processing an event */
 
 int recover_current_event(group_t *g)
@@ -1288,7 +1292,7 @@
 
 		list_del(&rev->list);
 		free_event(rev);
-		return;
+		return 0;
 	}
 
 	/* Before starting the rev we need to apply the node addition/removal
--- cluster/group/daemon/cpg.c	2006/06/21 18:10:23	1.25
+++ cluster/group/daemon/cpg.c	2006/06/21 20:43:54	1.26
@@ -20,8 +20,6 @@
 static int			saved_left_count;
 static cpg_handle_t		saved_handle;
 static struct cpg_name		saved_name;
-static int			saved_nodeid;
-static int			saved_pid;
 
 
 static node_t *find_group_node(group_t *g, int nodeid)
@@ -229,7 +227,7 @@
 				len = MAX_NAMELEN;
 			memcpy(&name, &group_name->value, len);
 
-			log_print("deliver_cb no group handle %d name %s",
+			log_print("deliver_cb no group handle %llx name %s",
 				  handle, name);
 			return;
 		}
@@ -267,7 +265,7 @@
 
 	g = find_group_by_handle(saved_handle);
 	if (!g) {
-		log_debug("process_confchg: no group for handle %u name %s",
+		log_debug("process_confchg: no group for handle %llx name %s",
 			  saved_handle, saved_name.value);
 		return;
 	}
--- cluster/group/daemon/gd_internal.h	2006/06/21 18:10:23	1.33
+++ cluster/group/daemon/gd_internal.h	2006/06/21 20:43:54	1.34
@@ -25,13 +25,14 @@
 #include <ctype.h>
 #include <dirent.h>
 #include <syslog.h>
+#include <time.h>
 #include <sys/socket.h>
 #include <sys/un.h>
 #include <sys/types.h>
 #include <sys/errno.h>
 #include <sys/poll.h>
-#include <sys/time.h>
 #include <sys/stat.h>
+#include <sys/wait.h>
 
 #include "list.h"
 #include "linux_endian.h"
@@ -256,6 +257,7 @@
 void app_start(app_t *a);
 void app_finish(app_t *a);
 void app_terminate(app_t *a);
+void app_deliver(app_t *a, struct save_msg *save);
 int client_add(int fd, void (*workfn)(int ci), void (*deadfn)(int ci));
 void client_dead(int ci);
 
--- cluster/group/daemon/joinleave.c	2006/06/20 20:26:08	1.15
+++ cluster/group/daemon/joinleave.c	2006/06/21 20:43:54	1.16
@@ -116,7 +116,6 @@
 	log_debug("%d:%s got leave", level, name);
 
 	rv = do_cpg_leave(g);
- out:
 	return rv;
 }
 
--- cluster/group/daemon/main.c	2006/06/20 20:27:40	1.36
+++ cluster/group/daemon/main.c	2006/06/21 20:43:54	1.37
@@ -218,6 +218,7 @@
 	app_action(a, buf);
 }
 
+#if 0
 static void make_args(char *buf, int *argc, char **argv, char sep)
 {
 	char *p = buf;
@@ -235,6 +236,7 @@
 	}
 	*argc = i;
 }
+#endif
 
 static char *get_args(char *buf, int *argc, char **argv, char sep, int want)
 {
@@ -659,7 +661,7 @@
 
 static int loop(void)
 {
-	int rv, fd, i, timeout = -1;
+	int rv, i, timeout = -1;
 	void (*workfn) (int ci);
 	void (*deadfn) (int ci);
 




More information about the Cluster-devel mailing list