فهرست منبع

Add quorum_fd_get and votequorum_fd_get prototypes

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1754 fd59a12c-fef9-0310-b244-a6a79926bd2f
Christine Caulfield 17 سال پیش
والد
کامیت
9a438085e2
3فایلهای تغییر یافته به همراه35 افزوده شده و 0 حذف شده
  1. 8 0
      include/corosync/quorum.h
  2. 7 0
      include/corosync/votequorum.h
  3. 20 0
      lib/votequorum.c

+ 8 - 0
include/corosync/quorum.h

@@ -70,6 +70,14 @@ cs_error_t quorum_finalize (
 	quorum_handle_t handle);
 	quorum_handle_t handle);
 
 
 
 
+/*
+ * Get a file descriptor on which to poll. quorum_handle_t is NOT a
+ * file descriptor and may not be used directly.
+ */
+cs_error_t quorum_fd_get (
+	quorum_handle_t handle,
+	int *fd);
+
 /*
 /*
  * Dispatch messages and configuration changes
  * Dispatch messages and configuration changes
  */
  */

+ 7 - 0
include/corosync/votequorum.h

@@ -110,6 +110,13 @@ cs_error_t votequorum_dispatch (
 	votequorum_handle_t handle,
 	votequorum_handle_t handle,
 	cs_dispatch_flags_t dispatch_types);
 	cs_dispatch_flags_t dispatch_types);
 
 
+/*
+ * Get a file descriptor on which to poll. votequorum_handle_t is NOT a
+ * file descriptor and may not be used directly.
+ */
+cs_error_t votequorum_fd_get (
+	votequorum_handle_t handle,
+	int *fd);
 
 
 /*
 /*
  * Get quorum information.
  * Get quorum information.

+ 20 - 0
lib/votequorum.c

@@ -670,6 +670,26 @@ cs_error_t votequorum_context_set (
 }
 }
 
 
 
 
+cs_error_t votequorum_fd_get (
+        votequorum_handle_t handle,
+        int *fd)
+{
+	cs_error_t error;
+        struct votequorum_inst *votequorum_inst;
+
+        error = saHandleInstanceGet (&votequorum_handle_t_db, handle, (void *)&votequorum_inst);
+        if (error != CS_OK) {
+                return (error);
+        }
+
+	*fd = votequorum_inst->dispatch_fd;
+
+	(void)saHandleInstancePut (&votequorum_handle_t_db, handle);
+
+	return (CS_OK);
+}
+
+
 struct res_overlay {
 struct res_overlay {
 	mar_res_header_t header __attribute__((aligned(8)));
 	mar_res_header_t header __attribute__((aligned(8)));
 	char data[512000];
 	char data[512000];