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

Function sam_mark_failed

lib/sam.c:759–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

757}
758
759cs_error_t sam_mark_failed (void)
760{
761 char command;
762 cs_error_t ret;
763
764 ret = CS_OK;
765
766 pthread_mutex_lock (&sam_internal_data.lock);
767
768 if (sam_internal_data.internal_status != SAM_INTERNAL_STATUS_STARTED &&
769 sam_internal_data.internal_status != SAM_INTERNAL_STATUS_REGISTERED) {
770 ret = CS_ERR_BAD_HANDLE;
771 goto exit_mutex_unlock;
772 }
773
774 if (!(sam_internal_data.recovery_policy & SAM_RECOVERY_POLICY_CMAP)) {
775 ret = CS_ERR_INVALID_PARAM;
776 goto exit_mutex_unlock;
777 }
778
779 command = SAM_COMMAND_MARK_FAILED;
780
781 if (sam_safe_write (sam_internal_data.child_fd_out, &command, sizeof (command)) != sizeof (command)) {
782 ret = CS_ERR_LIBRARY;
783 goto exit_mutex_unlock;
784 }
785
786exit_mutex_unlock:
787 pthread_mutex_unlock (&sam_internal_data.lock);
788
789 return (ret);
790}
791
792static cs_error_t sam_warn_signal_set_nolock (int warn_signal)
793{

Callers 1

test_cmap_restartFunction · 0.85

Calls 1

sam_safe_writeFunction · 0.85

Tested by 1

test_cmap_restartFunction · 0.68