Skip to content
Permalink
Browse files

lib: cmsis_rtos_v1: replace an else case

Replace an else-if case in osSemaphoreWait with
else to account for both EBUSY and EAGAIN return
values from k_sem_take. The return value would be
0 for osSemaphoreWait in both cases.

Signed-off-by: Niranjhana N <niranjhana.n@intel.com>
  • Loading branch information...
Niranjhana N authored and nashif committed Aug 23, 2018
1 parent dc537eb commit 845fdbb7c024f9d4ab2755bc8a4c331edd0b897f
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/cmsis_rtos_v1/cmsis_semaphore.c
@@ -68,11 +68,9 @@ int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t timeout)
*/
if (status == 0) {
return k_sem_count_get(semaphore) + 1;
} else if (status == -EAGAIN) {
} else {
return 0;
}

return -1;
}

/**

0 comments on commit 845fdbb

Please sign in to comment.
You can’t perform that action at this time.