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

Function cmap_get_string

lib/cmap.c:727–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

725}
726
727cs_error_t cmap_get_string(cmap_handle_t handle, const char *key_name, char **str)
728{
729 cs_error_t res;
730 size_t str_len;
731 cmap_value_types_t type;
732
733 res = cmap_get(handle, key_name, NULL, &str_len, &type);
734
735 if (res != CS_OK || type != CMAP_VALUETYPE_STRING) {
736 if (res == CS_OK) {
737 res = CS_ERR_INVALID_PARAM;
738 }
739
740 goto return_error;
741 }
742
743 *str = malloc(str_len);
744 if (*str == NULL) {
745 res = CS_ERR_NO_MEMORY;
746
747 goto return_error;
748 }
749
750 res = cmap_get(handle, key_name, *str, &str_len, &type);
751 if (res != CS_OK) {
752 free(*str);
753
754 goto return_error;
755 }
756
757 return (CS_OK);
758
759return_error:
760 return (res);
761}
762
763static cs_error_t cmap_adjust_int(cmap_handle_t handle, const char *key_name, int32_t step)
764{

Callers 9

get_quorum_typeFunction · 0.85
node_name_by_nodelistFunction · 0.85
nodestatusget_doFunction · 0.85
check_for_reload_errorsFunction · 0.85
print_keyFunction · 0.85
test_quorumFunction · 0.85
test_cmap_quitFunction · 0.85
test_cmap_restartFunction · 0.85

Calls 1

cmap_getFunction · 0.85

Tested by 3

test_quorumFunction · 0.68
test_cmap_quitFunction · 0.68
test_cmap_restartFunction · 0.68