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

Function corosync_cfg_try_shutdown

lib/cfg.c:562–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

560}
561
562cs_error_t
563corosync_cfg_try_shutdown (
564 corosync_cfg_handle_t cfg_handle,
565 corosync_cfg_shutdown_flags_t flags)
566{
567 struct cfg_inst *cfg_inst;
568 struct req_lib_cfg_tryshutdown req_lib_cfg_tryshutdown;
569 struct res_lib_cfg_tryshutdown res_lib_cfg_tryshutdown;
570 cs_error_t error;
571 struct iovec iov;
572
573 error = hdb_error_to_cs(hdb_handle_get (&cfg_hdb, cfg_handle,
574 (void *)&cfg_inst));
575 if (error != CS_OK) {
576 return (error);
577 }
578
579 req_lib_cfg_tryshutdown.header.id = MESSAGE_REQ_CFG_TRYSHUTDOWN;
580 req_lib_cfg_tryshutdown.header.size = sizeof (struct req_lib_cfg_tryshutdown);
581 req_lib_cfg_tryshutdown.flags = flags;
582
583 iov.iov_base = (void *)&req_lib_cfg_tryshutdown;
584 iov.iov_len = sizeof (req_lib_cfg_tryshutdown);
585
586 error = qb_to_cs_error (qb_ipcc_sendv_recv (cfg_inst->c,
587 &iov,
588 1,
589 &res_lib_cfg_tryshutdown,
590 sizeof (struct res_lib_cfg_tryshutdown), CS_IPC_TIMEOUT_MS));
591
592 (void)hdb_handle_put (&cfg_hdb, cfg_handle);
593
594 return (error == CS_OK ? res_lib_cfg_tryshutdown.header.error : error);
595}
596
597cs_error_t
598corosync_cfg_replyto_shutdown (

Callers 3

shutdown_doFunction · 0.85
mainFunction · 0.85
try_shutdownFunction · 0.85

Calls 4

hdb_error_to_csFunction · 0.85
hdb_handle_getFunction · 0.85
qb_to_cs_errorFunction · 0.85
hdb_handle_putFunction · 0.85

Tested by 1

mainFunction · 0.68