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/shm_ap_rbuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/shm_ap_rbuff.c') diff --git a/src/lib/shm_ap_rbuff.c b/src/lib/shm_ap_rbuff.c index f54627b7..e90afe19 100644 --- a/src/lib/shm_ap_rbuff.c +++ b/src/lib/shm_ap_rbuff.c @@ -348,9 +348,9 @@ ssize_t shm_ap_rbuff_read_port(struct shm_ap_rbuff * rb, int port_id) pid_t shm_ap_rbuff_get_api(struct shm_ap_rbuff *rb) { - pid_t api = 0; + pid_t api = -1; if (rb == NULL) - return 0; + return -1; pthread_mutex_lock(rb->shm_mutex); api = rb->api; -- cgit v1.2.3