summaryrefslogtreecommitdiffstats
path: root/registry/registry_db.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-06-09 04:52:39 +0000
commit89f3604407aff8f4cb2ed958252c61e23c767e24 (patch)
tree7fbf408102cab051557d38193524d8c6e991d070 /registry/registry_db.c
parentAdding upstream version 1.34.1. (diff)
downloadnetdata-89f3604407aff8f4cb2ed958252c61e23c767e24.tar.xz
netdata-89f3604407aff8f4cb2ed958252c61e23c767e24.zip
Adding upstream version 1.35.0.upstream/1.35.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'registry/registry_db.c')
-rw-r--r--registry/registry_db.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/registry/registry_db.c b/registry/registry_db.c
index c61a225c..db53ff7e 100644
--- a/registry/registry_db.c
+++ b/registry/registry_db.c
@@ -11,7 +11,9 @@ int registry_db_should_be_saved(void) {
// ----------------------------------------------------------------------------
// INTERNAL FUNCTIONS FOR SAVING REGISTRY OBJECTS
-static int registry_machine_save_url(void *entry, void *file) {
+static int registry_machine_save_url(const char *name, void *entry, void *file) {
+ (void)name;
+
REGISTRY_MACHINE_URL *mu = entry;
FILE *fp = file;
@@ -30,7 +32,9 @@ static int registry_machine_save_url(void *entry, void *file) {
return ret;
}
-static int registry_machine_save(void *entry, void *file) {
+static int registry_machine_save(const char *name, void *entry, void *file) {
+ (void)name;
+
REGISTRY_MACHINE *m = entry;
FILE *fp = file;
@@ -44,7 +48,7 @@ static int registry_machine_save(void *entry, void *file) {
);
if(ret >= 0) {
- int ret2 = dictionary_get_all(m->machine_urls, registry_machine_save_url, fp);
+ int ret2 = dictionary_walkthrough_read(m->machine_urls, registry_machine_save_url, fp);
if(ret2 < 0) return ret2;
ret += ret2;
}
@@ -75,7 +79,9 @@ static inline int registry_person_save_url(void *entry, void *file) {
return ret;
}
-static inline int registry_person_save(void *entry, void *file) {
+static inline int registry_person_save(const char *name, void *entry, void *file) {
+ (void)name;
+
REGISTRY_PERSON *p = entry;
FILE *fp = file;
@@ -89,7 +95,7 @@ static inline int registry_person_save(void *entry, void *file) {
);
if(ret >= 0) {
- //int ret2 = dictionary_get_all(p->person_urls, registry_person_save_url, fp);
+ //int ret2 = dictionary_walkthrough_read(p->person_urls, registry_person_save_url, fp);
int ret2 = avl_traverse(&p->person_urls, registry_person_save_url, fp);
if (ret2 < 0) return ret2;
ret += ret2;
@@ -126,10 +132,10 @@ int registry_db_save(void) {
return -1;
}
- // dictionary_get_all() has its own locking, so this is safe to do
+ // dictionary_walkthrough_read() has its own locking, so this is safe to do
debug(D_REGISTRY, "Saving all machines");
- int bytes1 = dictionary_get_all(registry.machines, registry_machine_save, fp);
+ int bytes1 = dictionary_walkthrough_read(registry.machines, registry_machine_save, fp);
if(bytes1 < 0) {
error("Registry: Cannot save registry machines - return value %d", bytes1);
fclose(fp);
@@ -139,7 +145,7 @@ int registry_db_save(void) {
debug(D_REGISTRY, "Registry: saving machines took %d bytes", bytes1);
debug(D_REGISTRY, "Saving all persons");
- int bytes2 = dictionary_get_all(registry.persons, registry_person_save, fp);
+ int bytes2 = dictionary_walkthrough_read(registry.persons, registry_person_save, fp);
if(bytes2 < 0) {
error("Registry: Cannot save registry persons - return value %d", bytes2);
fclose(fp);