[PATCH] tools: Fix check for return value in irm tool

  • From: Sander Vrijders <sander.vrijders@xxxxxxxx>
  • To: ouroboros@xxxxxxxxxxxxx
  • Date: Sat, 3 Feb 2018 14:26:13 +0100

A check was done in the irm tool for the pid of a newly created IPCP,
but it didn't catch all failures, this fixes that.

Signed-off-by: Sander Vrijders <sander.vrijders@xxxxxxxx>
---
 src/tools/irm/irm_ipcp_bootstrap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tools/irm/irm_ipcp_bootstrap.c 
b/src/tools/irm/irm_ipcp_bootstrap.c
index affe35a..2acb651 100644
--- a/src/tools/irm/irm_ipcp_bootstrap.c
+++ b/src/tools/irm/irm_ipcp_bootstrap.c
@@ -259,7 +259,7 @@ int do_bootstrap_ipcp(int     argc,
         len = irm_list_ipcps(name, &pids);
         if (len <= 0) {
                 pid = irm_create_ipcp(name, conf.type);
-                if (pid== 0)
+                if (pid <= 0)
                         return -1;
                 len = irm_list_ipcps(name, &pids);
         }
-- 
2.16.1


Other related posts:

  • » [PATCH] tools: Fix check for return value in irm tool - Sander Vrijders