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

Function delete_with_prefix

tools/corosync-cmapctl.c:444–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444static void delete_with_prefix(cmap_handle_t handle, const char *prefix)
445{
446 cmap_iter_handle_t iter_handle;
447 char key_name[CMAP_KEYNAME_MAXLEN + 1];
448 size_t value_len;
449 cmap_value_types_t type;
450 cs_error_t err;
451 cs_error_t err2;
452
453 err = cmap_iter_init(handle, prefix, &iter_handle);
454 if (err != CS_OK) {
455 fprintf (stderr, "Failed to initialize iteration. Error %s\n", cs_strerror(err));
456 exit (EXIT_FAILURE);
457 }
458
459 while ((err = cmap_iter_next(handle, iter_handle, key_name, &value_len, &type)) == CS_OK) {
460 err2 = cmap_delete(handle, key_name);
461 if (err2 != CS_OK) {
462 fprintf(stderr, "Can't delete key %s. Error %s\n", key_name, cs_strerror(err2));
463 }
464 }
465 cmap_iter_finalize(handle, iter_handle);
466}
467
468static void cmap_notify_fn(
469 cmap_handle_t cmap_handle,

Callers 2

read_in_config_fileFunction · 0.85
mainFunction · 0.85

Calls 5

cmap_iter_initFunction · 0.85
cs_strerrorFunction · 0.85
cmap_iter_nextFunction · 0.85
cmap_deleteFunction · 0.85
cmap_iter_finalizeFunction · 0.85

Tested by

no test coverage detected