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

Function sam_stop_nolock

lib/sam.c:649–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647}
648
649static cs_error_t sam_stop_nolock (void)
650{
651 char command;
652 cs_error_t cs_err;
653
654 if (sam_internal_data.internal_status != SAM_INTERNAL_STATUS_STARTED) {
655 return (CS_ERR_BAD_HANDLE);
656 }
657
658 command = SAM_COMMAND_STOP;
659
660 if (sam_safe_write (sam_internal_data.child_fd_out, &command, sizeof (command)) != sizeof (command)) {
661 return (CS_ERR_LIBRARY);
662 }
663
664 if (sam_internal_data.recovery_policy & SAM_RECOVERY_POLICY_CMAP) {
665 /*
666 * Wait for parent reply
667 */
668 if ((cs_err = sam_read_reply (sam_internal_data.child_fd_in)) != CS_OK) {
669 return (cs_err);
670 }
671 }
672
673 if (sam_internal_data.hc_callback) {
674 if (sam_safe_write (sam_internal_data.cb_wpipe_fd, &command, sizeof (command)) != sizeof (command)) {
675 return (CS_ERR_LIBRARY);
676 }
677 }
678
679 sam_internal_data.internal_status = SAM_INTERNAL_STATUS_REGISTERED;
680
681 return (CS_OK);
682}
683
684cs_error_t sam_stop (void)
685{

Callers 2

sam_stopFunction · 0.85
sam_finalizeFunction · 0.85

Calls 2

sam_safe_writeFunction · 0.85
sam_read_replyFunction · 0.85

Tested by

no test coverage detected