Hi,

the following patch moves strchr_rs out of util.c into the only plugin
that uses it and makes it static.

It address an unresolved symbol issue by loading plugins (via libconfdb
for example) without starting corosync main executive.

Please ACK for trunk and apply to flatiron too.

Fabio
Index: exec/util.c
===================================================================
--- exec/util.c	(revision 2404)
+++ exec/util.c	(working copy)
@@ -112,17 +112,6 @@
 	return ((char *)name->value);
 }
 
-char *strchr_rs (const char *haystack, int byte)
-{
-	const char *end_address = strchr (haystack, byte);
-	if (end_address) {
-		end_address += 1; /* skip past { or = */
-		end_address += strspn (end_address, " \t");
-	}
-
-	return ((char *) end_address);
-}
-
 void setcs_name_t (cs_name_t *name, char *str) {
 	strncpy ((char *)name->value, str, CS_MAX_NAME_LENGTH);
 	if (strlen ((char *)name->value) > CS_MAX_NAME_LENGTH) {
Index: exec/util.h
===================================================================
--- exec/util.h	(revision 2404)
+++ exec/util.h	(working copy)
@@ -73,7 +73,6 @@
   __attribute__((__noreturn__));
 void _corosync_out_of_memory_error (void) __attribute__((__noreturn__));
 extern char *getcs_name_t (cs_name_t *name);
-extern char *strchr_rs (const char *haystack, int byte);
 extern void setcs_name_t (cs_name_t *name, char *str);
 extern int cs_name_tisEqual (cs_name_t *str1, char *str2);
 #endif /* UTIL_H_DEFINED */
Index: exec/coroparse.c
===================================================================
--- exec/coroparse.c	(revision 2404)
+++ exec/coroparse.c	(working copy)
@@ -62,6 +62,17 @@
 static char error_string_response[512];
 
 
+static char *strchr_rs (const char *haystack, int byte)
+{
+	const char *end_address = strchr (haystack, byte);
+	if (end_address) {
+		end_address += 1; /* skip past { or = */
+		end_address += strspn (end_address, " \t");
+	}
+
+	return ((char *) end_address);
+}
+
 static int aisparser_readconfig (struct objdb_iface_ver0 *objdb,
 				 const char **error_string)
 {
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to