From bc9c60382b226e5a75a11a99364b9b799dc2b0c2 Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Tue, 5 Jul 2016 18:52:12 +0200 Subject: lib: Change invalid pid to -1 The stack used pid 0 (the scheduler) to indicate an invalid process instance, probably as a leftover from the deprecated application process instance id. Using -1 is a better solution. Fixes #16. --- src/lib/irm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/irm.c') diff --git a/src/lib/irm.c b/src/lib/irm.c index ee1851a3..4c71817d 100644 --- a/src/lib/irm.c +++ b/src/lib/irm.c @@ -67,7 +67,7 @@ int irm_destroy_ipcp(pid_t api) irm_msg_t * recv_msg = NULL; int ret = -1; - if (api == 0) + if (api == -1) return -EINVAL; msg.code = IRM_MSG_CODE__IRM_DESTROY_IPCP; @@ -97,7 +97,7 @@ int irm_bootstrap_ipcp(pid_t api, irm_msg_t * recv_msg = NULL; int ret = -1; - if (api == 0 || conf == NULL) + if (api == -1 || conf == NULL) return -EINVAL; msg.code = IRM_MSG_CODE__IRM_BOOTSTRAP_IPCP; @@ -209,7 +209,7 @@ int irm_enroll_ipcp(pid_t api, irm_msg_t * recv_msg = NULL; int ret = -1; - if (api == 0 || dif_name == NULL) + if (api == -1 || dif_name == NULL) return -EINVAL; msg.code = IRM_MSG_CODE__IRM_ENROLL_IPCP; -- cgit v1.2.3