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

Function sam_cmap_register

lib/sam.c:236–263  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236static cs_error_t sam_cmap_register (void)
237{
238 cs_error_t err;
239 cmap_handle_t cmap_handle;
240
241 if ((err = cmap_initialize (&cmap_handle)) != CS_OK) {
242 return (err);
243 }
244
245 snprintf(sam_internal_data.cmap_pid_path, CMAP_KEYNAME_MAXLEN, "resources.process.%d.", getpid());
246
247 sam_internal_data.cmap_handle = cmap_handle;
248
249 if ((err = sam_cmap_update_key (SAM_CMAP_KEY_RECOVERY, NULL)) != CS_OK) {
250 goto destroy_finalize_error;
251 }
252
253 if ((err = sam_cmap_update_key (SAM_CMAP_KEY_HC_PERIOD, NULL)) != CS_OK) {
254 goto destroy_finalize_error;
255 }
256
257 return (CS_OK);
258
259destroy_finalize_error:
260 sam_cmap_destroy_pid_path ();
261 cmap_finalize (cmap_handle);
262 return (err);
263}
264
265static void quorum_notification_fn (
266 quorum_handle_t handle,

Callers 1

sam_registerFunction · 0.85

Calls 4

cmap_initializeFunction · 0.85
sam_cmap_update_keyFunction · 0.85
cmap_finalizeFunction · 0.85

Tested by

no test coverage detected