From a293799161ef8004b32abc87cd56bb2cfc09d73f Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Wed, 25 Apr 2018 12:33:31 +0200 Subject: 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 Signed-off-by: Dimitri Staessens --- src/tools/irm/irm_ipcp_list.c | 11 +++++++++-- 1 file 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 +#include #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"); -- cgit v1.2.3