summaryrefslogtreecommitdiff
path: root/src/irmd/main.c
diff options
context:
space:
mode:
authordimitri staessens <[email protected]>2017-05-09 13:04:40 +0000
committerSander Vrijders <[email protected]>2017-05-09 13:04:40 +0000
commit40d3fd8cfaf93547428bae51bb34772ead7d32e7 (patch)
tree663937818ceeef46ecdf34829bea4902f34ef5d7 /src/irmd/main.c
parentfb5fd3771629c9276450b5618e0875cb3aac98bb (diff)
parent19718b97ba13390ff5f2b7453d0297e936db5653 (diff)
downloadouroboros-40d3fd8cfaf93547428bae51bb34772ead7d32e7.tar.gz
ouroboros-40d3fd8cfaf93547428bae51bb34772ead7d32e7.zip
Merged in dstaesse/ouroboros/be-irmd-unbind-fix (pull request #503)
irmd: Fix unbinding AP and AP-Is from a name
Diffstat (limited to 'src/irmd/main.c')
-rw-r--r--src/irmd/main.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/irmd/main.c b/src/irmd/main.c
index c9c989c5..3331c754 100644
--- a/src/irmd/main.c
+++ b/src/irmd/main.c
@@ -630,6 +630,8 @@ static int bind_api(pid_t api,
static int unbind_ap(char * ap,
char * name)
{
+ struct reg_entry * e;
+
if (ap == NULL)
return -EINVAL;
@@ -642,6 +644,10 @@ static int unbind_ap(char * ap,
apn_entry_del_name(e, name);
}
+ e = registry_get_entry(&irmd.registry, name);
+ if (e != NULL)
+ reg_entry_del_apn(e, ap);
+
pthread_rwlock_unlock(&irmd.reg_lock);
if (name == NULL)
@@ -652,9 +658,11 @@ static int unbind_ap(char * ap,
return 0;
}
-static int unbind_api(pid_t api,
- char * name)
+static int unbind_api(pid_t api,
+ const char * name)
{
+ struct reg_entry * e;
+
pthread_rwlock_wrlock(&irmd.reg_lock);
if (name == NULL)
@@ -664,6 +672,10 @@ static int unbind_api(pid_t api,
api_entry_del_name(e, name);
}
+ e = registry_get_entry(&irmd.registry, name);
+ if (e != NULL)
+ reg_entry_del_api(e, api);
+
pthread_rwlock_unlock(&irmd.reg_lock);
if (name == NULL)