diff options
author | Sander Vrijders <[email protected]> | 2018-04-25 12:33:31 +0200 |
---|---|---|
committer | Dimitri Staessens <[email protected]> | 2018-04-25 14:53:19 +0200 |
commit | a293799161ef8004b32abc87cd56bb2cfc09d73f (patch) | |
tree | b9cbf3c55ab58101ae4f28e481b26e40de58c80b /src | |
parent | 490ff55829df88fd57a1fa50f5e75b36faa4035a (diff) | |
download | ouroboros-a293799161ef8004b32abc87cd56bb2cfc09d73f.tar.gz ouroboros-a293799161ef8004b32abc87cd56bb2cfc09d73f.zip |
tools: Add check for irm ipcp list
This adds a check in the irm ipcp list command to see if
irm_list_ipcps returned an error or not. Before it was only checking
if there were zero IPCPs in the system.
Signed-off-by: Sander Vrijders <[email protected]>
Signed-off-by: Dimitri Staessens <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/tools/irm/irm_ipcp_list.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/tools/irm/irm_ipcp_list.c b/src/tools/irm/irm_ipcp_list.c index e16ca523..5a9ecaff 100644 --- a/src/tools/irm/irm_ipcp_list.c +++ b/src/tools/irm/irm_ipcp_list.c @@ -37,6 +37,7 @@ */ #include <ouroboros/irm.h> +#include <ouroboros/errno.h> #include "irm_ops.h" #include "irm_utils.h" @@ -130,7 +131,12 @@ int do_list_ipcp(int argc, if (len == 0) { printf("No IPCPs in system.\n\n"); return 0; - } + } else if (len == -EIRMD) { + printf("Failed to communicate with the " + "Ouroboros IPC Resource Manager daemon.\n"); + return -1; + } else if (len < 0) + return len; /* FIXME: Implement filtering based on type and name. */ (void) type; @@ -138,7 +144,8 @@ int do_list_ipcp(int argc, printf("+---------+----------------------+------------+" "----------------------+\n"); - printf("| %7s | %20s | %10s | %20s |\n", "pid", "name", "type", "layer"); + printf("| %7s | %20s | %10s | %20s |\n", "pid", "name", + "type", "layer"); printf("+---------+----------------------+------------+" "----------------------+\n"); |