summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-07-06 16:05:34 +0200
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-07-06 16:05:34 +0200
commit972c1413933c5e2ef884a7ebbad066404192eec2 (patch)
tree8a56b6ea02498712bf51768583a889f4347a0a3b /src
parent6c799af1b4cf86a32979d98034c560fb976a9caf (diff)
parentf437a4a122614a01a1f97713ddc6e45c1011b86f (diff)
downloadouroboros-972c1413933c5e2ef884a7ebbad066404192eec2.tar.gz
ouroboros-972c1413933c5e2ef884a7ebbad066404192eec2.zip
Merged in dstaesse/ouroboros/be-registry-refactor (pull request #158)
irmd: Rename registry functions
Diffstat (limited to 'src')
-rw-r--r--src/irmd/main.c15
-rw-r--r--src/irmd/registry.c12
-rw-r--r--src/irmd/registry.h12
3 files changed, 20 insertions, 19 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index de100cf8..e59d3c2a 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -715,8 +715,9 @@ static struct port_map_entry * flow_accept(pid_t api,
}
if (!reg_entry_has_api(rne, api)) {
- rgi = registry_add_ap_instance(&instance->registry,
- rne->name, api);
+ rgi = registry_add_api_name(&instance->registry,
+ api,
+ rne->name);
if (rgi == NULL) {
pthread_rwlock_unlock(&instance->reg_lock);
pthread_rwlock_unlock(&instance->state_lock);
@@ -800,7 +801,7 @@ static int flow_alloc_resp(pid_t n_api,
pthread_mutex_lock(&rne->state_lock);
- registry_remove_ap_instance(&instance->registry, rne->name, n_api);
+ registry_remove_api_name(&instance->registry, n_api, rne->name);
pthread_mutex_unlock(&rne->state_lock);
@@ -1392,12 +1393,12 @@ void * irm_flow_cleaner()
next);
if (kill(r->api, 0) < 0) {
LOG_INFO("Process %d gone, "
- "instance deleted.",
+ "registry binding removed.",
r->api);
- registry_remove_ap_instance(
+ registry_remove_api_name(
&instance->registry,
- e->name,
- r->api);
+ r->api,
+ e->name);
}
}
}
diff --git a/src/irmd/registry.c b/src/irmd/registry.c
index a4e2fcfa..ae532d5a 100644
--- a/src/irmd/registry.c
+++ b/src/irmd/registry.c
@@ -491,9 +491,9 @@ int registry_remove_ap_auto(struct list_head * registry,
}
-struct reg_instance * registry_add_ap_instance(struct list_head * registry,
- char * name,
- pid_t api)
+struct reg_instance * registry_add_api_name(struct list_head * registry,
+ pid_t api,
+ char * name)
{
struct reg_entry * e = NULL;
struct reg_instance * i = NULL;
@@ -534,9 +534,9 @@ struct reg_instance * registry_add_ap_instance(struct list_head * registry,
return i;
}
-int registry_remove_ap_instance(struct list_head * registry,
- char * name,
- pid_t api)
+int registry_remove_api_name(struct list_head * registry,
+ pid_t api,
+ char * name)
{
struct reg_entry * e = NULL;
struct reg_instance * i = NULL;
diff --git a/src/irmd/registry.h b/src/irmd/registry.h
index 36b68dcd..83b9d393 100644
--- a/src/irmd/registry.h
+++ b/src/irmd/registry.h
@@ -130,12 +130,12 @@ int registry_add_ap_auto(struct list_head * registry,
int registry_remove_ap_auto(struct list_head * registry,
char * name,
char * ap_name);
-struct reg_instance * registry_add_ap_instance(struct list_head * registry,
- char * name,
- pid_t api);
-int registry_remove_ap_instance(struct list_head * registry,
- char * name,
- pid_t api);
+struct reg_instance * registry_add_api_name(struct list_head * registry,
+ pid_t api,
+ char * name);
+int registry_remove_api_name(struct list_head * registry,
+ pid_t api,
+ char * name);
struct reg_entry * registry_get_entry_by_name(struct list_head * registry,
char * name);
struct reg_entry * registry_get_entry_by_ap_name(struct list_head * registry,