From 9a438085e2e0829b9f1f8dfd413b538e31c7f3ac Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Fri, 30 Jan 2009 13:31:40 +0000 Subject: [PATCH] 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 --- include/corosync/quorum.h | 8 ++++++++ include/corosync/votequorum.h | 7 +++++++ lib/votequorum.c | 20 ++++++++++++++++++++ 3 files changed, 35 insertions(+) diff --git a/include/corosync/quorum.h b/include/corosync/quorum.h index 291a69c6..2ca07ce5 100644 --- a/include/corosync/quorum.h +++ b/include/corosync/quorum.h @@ -70,6 +70,14 @@ cs_error_t quorum_finalize ( 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 */ diff --git a/include/corosync/votequorum.h b/include/corosync/votequorum.h index 7c758ccc..b6807ae8 100644 --- a/include/corosync/votequorum.h +++ b/include/corosync/votequorum.h @@ -110,6 +110,13 @@ cs_error_t votequorum_dispatch ( votequorum_handle_t handle, 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. diff --git a/lib/votequorum.c b/lib/votequorum.c index c4408cec..a4ad461e 100644 --- a/lib/votequorum.c +++ b/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 { mar_res_header_t header __attribute__((aligned(8))); char data[512000];