Răsfoiți Sursa

Correct missing poll funtions from service handler struct needed for confdb APIs

Signed-off-by: Steven Dake <sdake@redhat.com>
Reviewed-by: Jan Friesse <jfriesse@redhat.com>
(cherry picked from commit c544e87bb0bfdb6e2c5a43ec01113f814e738550)
Steven Dake 14 ani în urmă
părinte
comite
10c074ef48
3 a modificat fișierele cu 21 adăugiri și 4 ștergeri
  1. 3 1
      exec/apidef.c
  2. 16 1
      include/corosync/engine/coroapi.h
  3. 2 2
      services/confdb.c

+ 3 - 1
exec/apidef.c

@@ -144,7 +144,9 @@ static struct corosync_api_v1 apidef_corosync_api_v1 = {
 	.fatal_error = _corosync_public_exit_error,
 	.fatal_error = _corosync_public_exit_error,
 	.shutdown_request = corosync_shutdown_request,
 	.shutdown_request = corosync_shutdown_request,
 	.state_dump = corosync_state_dump,
 	.state_dump = corosync_state_dump,
-	.poll_handle_get = corosync_poll_handle_get
+	.poll_handle_get = corosync_poll_handle_get,
+	.poll_dispatch_add = poll_dispatch_add,
+	.poll_dispatch_delete = poll_dispatch_delete
 };
 };
 
 
 void apidef_init (struct objdb_iface_ver0 *objdb) {
 void apidef_init (struct objdb_iface_ver0 *objdb) {

+ 16 - 1
include/corosync/engine/coroapi.h

@@ -608,7 +608,6 @@ struct corosync_api_v1 {
 	 */
 	 */
 	hdb_handle_t (*poll_handle_get) (void);
 	hdb_handle_t (*poll_handle_get) (void);
 
 
-
 	int (*object_key_create_typed) (
 	int (*object_key_create_typed) (
 		hdb_handle_t object_handle,
 		hdb_handle_t object_handle,
 		const char *key_name,
 		const char *key_name,
@@ -636,6 +635,22 @@ struct corosync_api_v1 {
 		hdb_handle_t *handle,
 		hdb_handle_t *handle,
 		int (schedwrk_fn) (const void *),
 		int (schedwrk_fn) (const void *),
 		const void *context);
 		const void *context);
+
+	int (*poll_dispatch_add) (hdb_handle_t handle,
+		int fd,
+		int events,
+		void *data,
+
+		int (*dispatch_fn) (hdb_handle_t handle,
+			int fd,
+			int revents,
+			void *data));
+
+
+	int (*poll_dispatch_delete) (
+		hdb_handle_t handle,
+		int fd);
+
 };
 };
 
 
 #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )
 #define SERVICE_ID_MAKE(a,b) ( ((a)<<16) | (b) )

+ 2 - 2
services/confdb.c

@@ -321,7 +321,7 @@ __attribute__ ((constructor)) static void corosync_lcr_component_register (void)
 
 
 static int confdb_exec_exit_fn(void)
 static int confdb_exec_exit_fn(void)
 {
 {
-	poll_dispatch_delete(api->poll_handle_get(), notify_pipe[0]);
+	api->poll_dispatch_delete(api->poll_handle_get(), notify_pipe[0]);
 	close(notify_pipe[0]);
 	close(notify_pipe[0]);
 	close(notify_pipe[1]);
 	close(notify_pipe[1]);
 	return 0;
 	return 0;
@@ -347,7 +347,7 @@ static int confdb_exec_init_fn (
 		}
 		}
 	}
 	}
 
 
-	return poll_dispatch_add(api->poll_handle_get(), notify_pipe[0],
+	return api->poll_dispatch_add(api->poll_handle_get(), notify_pipe[0],
 		POLLIN, NULL, objdb_notify_dispatch);
 		POLLIN, NULL, objdb_notify_dispatch);
 }
 }