| 560 | } |
| 561 | |
| 562 | cs_error_t |
| 563 | corosync_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 | |
| 597 | cs_error_t |
| 598 | corosync_cfg_replyto_shutdown ( |