diff --git a/snmp_subagent/hbagentv2.c b/snmp_subagent/hbagentv2.c index 3979bd3..1a67968 100644 --- a/snmp_subagent/hbagentv2.c +++ b/snmp_subagent/hbagentv2.c @@ -70,6 +70,9 @@ static GPtrArray * gResourceTableV2 = NULL; static int err_occurs = 0; /* the flag which means an error occurs in callback func. */ extern const char *myid; extern const char *myuuid; +#if HAVE_CRM_IPC_NEW +static int ipc_fd = 0; +#endif #if !HAVE_DECL_CRM_CONCAT static char * @@ -555,7 +558,11 @@ init_cib(void) cl_log(LOG_ERR, "CIB connection initialization failed."); return HA_FAIL; } +#if !HAVE_CRM_IPC_NEW rc = cib_conn->cmds->signon(cib_conn, LHAAGENTID, cib_query); +#else + rc = cib_conn->cmds->signon_raw(cib_conn, LHAAGENTID, cib_query, &ipc_fd); +#endif if (rc != 0) { cl_log(LOG_ERR, "CIB connection signon failed."); return HA_FAIL; @@ -597,16 +604,22 @@ free_cib(void) int get_cib_fd(void) { +#if !HAVE_CRM_IPC_NEW int fd; +#endif if (!cib_conn) { cl_log(LOG_ERR, "CIB is not initialized."); return -1; } +#if !HAVE_CRM_IPC_NEW if ((fd = cib_conn->cmds->inputfd(cib_conn)) < 0) { cl_log(LOG_ERR, "Can not get CIB inputfd."); return -1; } return fd; +#else + return ipc_fd; +#endif } /**