summaryrefslogtreecommitdiff
path: root/src/lib/irm.c
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-12-28 10:57:04 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-12-28 10:57:04 +0100
commit43a3231b03aa0a639bcd8d61784c84095edfdb6e (patch)
tree3e722461be65504e6658f75b7b651f93bb8764e1 /src/lib/irm.c
parentbd99555a130400cfec1cbdcf5e4eaa08f133d041 (diff)
parentf8e230049143412ac424d4cbfd4ca95b6c7f64e1 (diff)
downloadouroboros-43a3231b03aa0a639bcd8d61784c84095edfdb6e.tar.gz
ouroboros-43a3231b03aa0a639bcd8d61784c84095edfdb6e.zip
Merged in dstaesse/ouroboros/be-qoscube (pull request #329)
Some fixes
Diffstat (limited to 'src/lib/irm.c')
-rw-r--r--src/lib/irm.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c
index 4b9a6285..969a78c3 100644
--- a/src/lib/irm.c
+++ b/src/lib/irm.c
@@ -47,7 +47,7 @@ pid_t irm_create_ipcp(char * name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -75,7 +75,7 @@ int irm_destroy_ipcp(pid_t api)
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -147,9 +147,8 @@ int irm_bootstrap_ipcp(pid_t api,
}
recv_msg = send_recv_irm_msg(&msg);
- if (recv_msg == NULL) {
- return -1;
- }
+ if (recv_msg == NULL)
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -179,7 +178,7 @@ ssize_t irm_list_ipcps(char * name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL) {
free(msg.dif_name);
- return -1;
+ return -EIRMD;
}
if (recv_msg->apis == NULL) {
@@ -227,7 +226,7 @@ int irm_enroll_ipcp(pid_t api,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL) {
free(msg.dif_name);
- return -1;
+ return -EIRMD;
}
if (recv_msg->has_result == false) {
@@ -358,8 +357,11 @@ int irm_bind_ap(char * ap,
msg.opts = opts;
recv_msg = send_recv_irm_msg(&msg);
+
+ free(full_ap_name);
+
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -369,7 +371,6 @@ int irm_bind_ap(char * ap,
ret = recv_msg->result;
irm_msg__free_unpacked(recv_msg, NULL);
- free(full_ap_name);
return ret;
}
@@ -389,7 +390,7 @@ int irm_bind_api(pid_t api, char * name)
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -417,7 +418,7 @@ int irm_unbind_ap(char * ap, char * name)
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -446,7 +447,7 @@ int irm_unbind_api(pid_t api, char * name)
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -479,7 +480,7 @@ int irm_reg(char * name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);
@@ -513,7 +514,7 @@ int irm_unreg(char * name,
recv_msg = send_recv_irm_msg(&msg);
if (recv_msg == NULL)
- return -1;
+ return -EIRMD;
if (recv_msg->has_result == false) {
irm_msg__free_unpacked(recv_msg, NULL);