diff options
author | dimitri staessens <[email protected]> | 2016-12-28 00:36:36 +0100 |
---|---|---|
committer | dimitri staessens <[email protected]> | 2016-12-28 01:05:20 +0100 |
commit | 314c5323d3a038394f43e84d72594b78d17b1a46 (patch) | |
tree | 5c82135181d99879725f59cc4c263e9ec4e95049 /src/lib/irm.c | |
parent | 6166259f74855fe9e6976175eeb7b16912bc477a (diff) | |
download | ouroboros-314c5323d3a038394f43e84d72594b78d17b1a46.tar.gz ouroboros-314c5323d3a038394f43e84d72594b78d17b1a46.zip |
include, lib: Report communication failure with the IRMd
An errno EIRMD has been added to errno.h to indicate failure to send a
message tot the IRMd. The IRM tool will report such errors, which
makes it easier for users to detect that the IRM was not started or
has failed.
Diffstat (limited to 'src/lib/irm.c')
-rw-r--r-- | src/lib/irm.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/lib/irm.c b/src/lib/irm.c index 0d9d0f86..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) { @@ -362,7 +361,7 @@ int irm_bind_ap(char * ap, 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); @@ -391,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); @@ -419,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); @@ -448,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); @@ -481,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); @@ -515,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); |