cman uses this handle but it is not exported anywhere.  Properly export
it via coroapi rather then relying on its symbol name to never change.
Index: include/corosync/engine/coroapi.h
===================================================================
--- include/corosync/engine/coroapi.h	(revision 2316)
+++ include/corosync/engine/coroapi.h	(working copy)
@@ -583,6 +583,12 @@
 	void (*shutdown_request) (void);
 
 	void (*state_dump) (void);
+
+	/*
+	 * The use of this interface is highly discouraged.
+	 * Please avoid using any of coropoll apis in your service engines.
+	 */
+	hdb_handle_t (*poll_handle_get) (void);
 };
 
 #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
Index: exec/apidef.c
===================================================================
--- exec/apidef.c	(revision 2316)
+++ exec/apidef.c	(working copy)
@@ -141,7 +141,8 @@
 	.error_memory_failure = _corosync_out_of_memory_error,
 	.fatal_error = _corosync_public_exit_error,
 	.shutdown_request = corosync_shutdown_request,
-	.state_dump = corosync_state_dump
+	.state_dump = corosync_state_dump,
+	.poll_handle_get = corosync_poll_handle_get
 };
 
 void apidef_init (struct objdb_iface_ver0 *objdb) {
Index: exec/main.c
===================================================================
--- exec/main.c	(revision 2316)
+++ exec/main.c	(working copy)
@@ -126,10 +126,15 @@
 
 static int sync_in_process = 1;
 
-hdb_handle_t corosync_poll_handle;
+static hdb_handle_t corosync_poll_handle;
 
 struct sched_param global_sched_param;
 
+hdb_handle_t corosync_poll_handle_get (void)
+{
+	return (corosync_poll_handle);
+}
+
 void corosync_state_dump (void)
 {
 	int i;
Index: exec/main.h
===================================================================
--- exec/main.h	(revision 2316)
+++ exec/main.h	(working copy)
@@ -45,8 +45,9 @@
 #include <corosync/engine/config.h>
 #include <corosync/engine/coroapi.h>
 
-extern hdb_handle_t corosync_poll_handle;
-
+/*
+ * DO NOT USE SYMBOLS IN THIS FILE
+ */
 extern unsigned long long *(*main_clm_get_by_nodeid) (unsigned int node_id);
 
 extern void main_get_config_modules(struct config_iface_ver0 ***modules, int *num);
@@ -64,4 +65,6 @@
 
 extern void corosync_state_dump (void);
 
+extern hdb_handle_t corosync_poll_handle_get (void);
+
 #endif /* MAIN_H_DEFINED */
_______________________________________________
Openais mailing list
[email protected]
https://lists.linux-foundation.org/mailman/listinfo/openais

Reply via email to