summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordimitri staessens <dimitri.staessens@intec.ugent.be>2016-09-01 09:01:53 +0200
committerdimitri staessens <dimitri.staessens@intec.ugent.be>2016-09-01 09:01:53 +0200
commit1ea22e8293924ae671dd142b76c8d6e68fbcafde (patch)
tree80e07d8bba2933e6dc9888691d023843624ccef1 /src
parent380837a8e9677220f706113b9b34e40a5b40c5d8 (diff)
downloadouroboros-1ea22e8293924ae671dd142b76c8d6e68fbcafde.tar.gz
ouroboros-1ea22e8293924ae671dd142b76c8d6e68fbcafde.zip
irmd: Fix registering AP-I before bind
Diffstat (limited to 'src')
-rw-r--r--src/irmd/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index 465415b8..a69dd526 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -579,6 +579,7 @@ static int bind_api(pid_t api,
{
char * name_dup = NULL;
struct api_entry * e = NULL;
+ struct reg_entry * re = NULL;
if (name == NULL)
return -EINVAL;
@@ -617,6 +618,10 @@ static int bind_api(pid_t api,
return -1;
}
+ re = registry_get_entry(&irmd->registry, name);
+ if (re != NULL && reg_entry_add_api(re, api) < 0)
+ LOG_ERR("Failed adding AP-I %d for name %s.", api, name);
+
pthread_rwlock_unlock(&irmd->reg_lock);
pthread_rwlock_unlock(&irmd->state_lock);
@@ -923,7 +928,7 @@ static int api_announce(pid_t api, char * apn)
}
list_add(&n->next, &e->names);
- LOG_DBG("API %d inherits listen name %s from AP %s.",
+ LOG_DBG("AP-I %d inherits listen name %s from AP %s.",
api, n->str, e->apn);
}
}
@@ -1307,7 +1312,7 @@ static pid_t auto_execute(char ** argv)
}
if (api != 0) {
- LOG_INFO("Instantiated %s as AP-i %d.", argv[0], api);
+ LOG_INFO("Instantiated %s as AP-I %d.", argv[0], api);
return api;
}