diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-06-22 16:05:56 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-06-22 16:07:56 +0200 |
commit | fa0a0dbc88adcf9cff8bf35a253f020a49ff4084 (patch) | |
tree | 4af7b471aeeff9d5f6224c48fcaf067104ac0a07 /src/lib/irm.c | |
parent | aa6255a605cac034089c78562c0d000aacd0af1e (diff) | |
download | ouroboros-fa0a0dbc88adcf9cff8bf35a253f020a49ff4084.tar.gz ouroboros-fa0a0dbc88adcf9cff8bf35a253f020a49ff4084.zip |
lib: Add errnos specific for Ouroboros
This adds error numbers specificly for Ouroboros. It also refactors
some of the header files that are installed.
Fixes #2
Diffstat (limited to 'src/lib/irm.c')
-rw-r--r-- | src/lib/irm.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c index ff5c3237..01ee498c 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -22,6 +22,7 @@ #define OUROBOROS_PREFIX "libouroboros-irm" +#include <ouroboros/errno.h> #include <ouroboros/irm.h> #include <ouroboros/common.h> #include <ouroboros/logs.h> @@ -47,7 +48,7 @@ pid_t irm_create_ipcp(char * ipcp_name, recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) - return -1; + return -EIRM; if (recv_msg->has_result == false) { irm_msg__free_unpacked(recv_msg, NULL); @@ -76,7 +77,7 @@ int irm_destroy_ipcp(instance_name_t * api) recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) - return -1; + return -EIRM; if (recv_msg->has_result == false) { irm_msg__free_unpacked(recv_msg, NULL); @@ -143,12 +144,12 @@ int irm_bootstrap_ipcp(instance_name_t * api, config.if_name = conf->if_name; break; default: - return -1; + return -EIPCPTYPE; } recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) { - return -1; + return -EIRM; } if (recv_msg->has_result == false) { @@ -180,14 +181,14 @@ int irm_enroll_ipcp(instance_name_t * api, msg.dif_name = malloc(sizeof(*(msg.dif_name))); if (msg.dif_name == NULL) { LOG_ERR("Failed to malloc"); - return -1; + return -ENOMEM; } msg.dif_name[0] = dif_name; recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) { free(msg.dif_name); - return -1; + return -EIRM; } if (recv_msg->has_result == false) { @@ -238,7 +239,7 @@ int irm_reg(char * name, recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) - return -1; + return -EIRM; if (recv_msg->has_result == false) { irm_msg__free_unpacked(recv_msg, NULL); @@ -284,7 +285,7 @@ int irm_unreg(char * name, recv_msg = send_recv_irm_msg(&msg); if (recv_msg == NULL) - return -1; + return -EIRM; if (recv_msg->has_result == false) { irm_msg__free_unpacked(recv_msg, NULL); |