MCPcopy Create free account
hub / github.com/corosync/corosync / corosync_cfg_initialize

Function corosync_cfg_initialize

lib/cfg.c:84–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82 */
83
84cs_error_t
85corosync_cfg_initialize (
86 corosync_cfg_handle_t *cfg_handle,
87 const corosync_cfg_callbacks_t *cfg_callbacks)
88{
89 struct cfg_inst *cfg_inst;
90 cs_error_t error = CS_OK;
91
92 error = hdb_error_to_cs (hdb_handle_create (&cfg_hdb, sizeof (struct cfg_inst), cfg_handle));
93 if (error != CS_OK) {
94 goto error_no_destroy;
95 }
96
97 error = hdb_error_to_cs (hdb_handle_get (&cfg_hdb, *cfg_handle, (void *)&cfg_inst));
98 if (error != CS_OK) {
99 goto error_destroy;
100 }
101
102 cfg_inst->finalize = 0;
103 cfg_inst->c = qb_ipcc_connect ("cfg", IPC_REQUEST_SIZE);
104 if (cfg_inst->c == NULL) {
105 error = qb_to_cs_error(-errno);
106 goto error_put_destroy;
107 }
108
109 if (cfg_callbacks) {
110 memcpy (&cfg_inst->callbacks, cfg_callbacks, sizeof (corosync_cfg_callbacks_t));
111 }
112
113 (void)hdb_handle_put (&cfg_hdb, *cfg_handle);
114
115 return (CS_OK);
116
117error_put_destroy:
118 (void)hdb_handle_put (&cfg_hdb, *cfg_handle);
119error_destroy:
120 (void)hdb_handle_destroy (&cfg_hdb, *cfg_handle);
121error_no_destroy:
122 return (error);
123}
124
125cs_error_t
126corosync_cfg_fd_get (

Callers 11

init_allFunction · 0.85
nodestatusget_doFunction · 0.85
reload_config_doFunction · 0.85
reopen_log_files_doFunction · 0.85
shutdown_doFunction · 0.85
showaddrs_doFunction · 0.85
killnode_doFunction · 0.85
_cs_local_node_info_getFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
initializeFunction · 0.85

Calls 6

hdb_error_to_csFunction · 0.85
hdb_handle_createFunction · 0.85
hdb_handle_getFunction · 0.85
qb_to_cs_errorFunction · 0.85
hdb_handle_putFunction · 0.85
hdb_handle_destroyFunction · 0.85

Tested by 1

mainFunction · 0.68