All of lore.kernel.org
 help / color / mirror / Atom feed
* [Cluster-devel] cluster/rgmanager/src/daemons Makefile reslist ...
@ 2007-01-26 21:57 lhh
  0 siblings, 0 replies; only message in thread
From: lhh @ 2007-01-26 21:57 UTC (permalink / raw)
  To: cluster-devel.redhat.com

CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	lhh at sourceware.org	2007-01-26 21:57:01

Modified files:
	rgmanager/src/daemons: Makefile reslist.c resrules.c 

Log message:
	Port fix for logging of errors in config from RHEL5 branch

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/Makefile.diff?cvsroot=cluster&r1=1.14&r2=1.15
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/reslist.c.diff?cvsroot=cluster&r1=1.15&r2=1.16
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/daemons/resrules.c.diff?cvsroot=cluster&r1=1.17&r2=1.18

--- cluster/rgmanager/src/daemons/Makefile	2006/07/12 14:38:01	1.14
+++ cluster/rgmanager/src/daemons/Makefile	2007/01/26 21:57:01	1.15
@@ -59,7 +59,7 @@
 # packages should run 'make check' as part of the build process.
 #
 rg_test: rg_locks-noccs.o test-noccs.o reslist-noccs.o \
-		resrules.o restree-noccs.o fo_domain-noccs.o
+		resrules-noccs.o restree-noccs.o fo_domain-noccs.o
 	$(CC) -o $@ $^ $(INCLUDE) $(CFLAGS) -llalloc $(LDFLAGS) -lccs -lcman
 
 clurmtabd: clurmtabd.o clurmtabd_lib.o
--- cluster/rgmanager/src/daemons/reslist.c	2007/01/26 21:42:30	1.15
+++ cluster/rgmanager/src/daemons/reslist.c	2007/01/26 21:57:01	1.16
@@ -28,6 +28,9 @@
 #include <list.h>
 #include <reslist.h>
 #include <pthread.h>
+#ifndef NO_CCS
+#include <clulog.h>
+#endif
 
 
 char *attr_value(resource_node_t *node, char *attrname);
@@ -261,6 +264,8 @@
 
 /**
    Find a root resource by ref (service, usually).  No name is required.
+   Only one type of root resource may exist because of the primary
+   attribute flag
 
    @param reslist	List of resources to traverse.
    @param ref		Reference
@@ -359,12 +364,29 @@
 					/*
 					   Unique/primary is not unique
 					 */
-					printf("Unique/primary not unique "
-					       "type %s, %s=%s\n",
+#ifdef NO_CCS
+					printf("Error: "
+                                               "%s attribute collision. "
+                                               "type=%s attr=%s value=%s\n",
+					       (newres->r_attrs[x].ra_flags&
+                                                RA_PRIMARY)?"Primary":
+                                               "Unique",
+					       newres->r_rule->rr_type,
+					       newres->r_attrs[x].ra_name,
+					       newres->r_attrs[x].ra_value
+					       );
+#else 
+					clulog(LOG_ERR,
+                                               "%s attribute collision. "
+                                               "type=%s attr=%s value=%s\n",
+					       (newres->r_attrs[x].ra_flags&
+                                                RA_PRIMARY)?"Primary":
+                                               "Unique",
 					       newres->r_rule->rr_type,
 					       newres->r_attrs[x].ra_name,
 					       newres->r_attrs[x].ra_value
 					       );
+#endif
 					return -1;
 				}
 				break;
@@ -756,14 +778,21 @@
 		for (resID = 1; ; resID++) {
 			snprintf(tok, sizeof(tok), RESOURCE_BASE "/%s[%d]",
 				 currule->rr_type, resID);
-
+			
 			newres = load_resource(ccsfd, currule, tok);
 			if (!newres)
 				break;
 
 		       if (store_resource(reslist, newres) != 0) {
+#ifdef NO_CCS
 	       		       printf("Error storing %s resource\n",
 				      newres->r_rule->rr_type);
+#else
+	       		       clulog(LOG_ERR,
+				      "Error storing %s resource\n",
+				      newres->r_rule->rr_type);
+#endif
+
 			       destroy_resource(newres);
 		       }
 
--- cluster/rgmanager/src/daemons/resrules.c	2007/01/26 21:42:30	1.17
+++ cluster/rgmanager/src/daemons/resrules.c	2007/01/26 21:57:01	1.18
@@ -31,7 +31,9 @@
 #include <pthread.h>
 #include <dirent.h>
 #include <libgen.h>
+#ifndef NO_CCS
 #include <clulog.h>
+#endif
 
 
 /**
@@ -46,11 +48,16 @@
 store_rule(resource_rule_t **rulelist, resource_rule_t *newrule)
 {
 	resource_rule_t *curr;
-	
+
 	list_do(rulelist, curr) {
 		if (!strcasecmp(newrule->rr_type, curr->rr_type)) {
+#ifdef NO_CCS
 			fprintf(stderr, "Error storing %s: Duplicate\n",
 				newrule->rr_type);
+#else
+			clulog(LOG_ERR, "Error storing %s: Duplicate\n",
+			       newrule->rr_type);
+#endif
 			return -1;
 		}
 
@@ -920,9 +927,15 @@
 			break;
 		
 		if (!strcasecmp(type, "action")) {
+#ifdef NO_CCS
 			fprintf(stderr,
 				"Error: Resource type '%s' is reserved",
 				type);
+#else
+			clulog(LOG_ERR,
+				"Error: Resource type '%s' is reserved",
+				type);
+#endif
 			free(type);
 			break;
 		}



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-01-26 21:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-26 21:57 [Cluster-devel] cluster/rgmanager/src/daemons Makefile reslist lhh

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.