mm/mm_heap/mm_sem : Modfiy to return negated errno in failure case of mm_trysemaphore
umm_trysemaphore and kmm_trysemaphore return negated errno in failure case, but mm_trysemaphore returns only ERROR.
umm and kmm trysemaphore use the return of mm_trysemaphore, so matching the return of mm_trysemaphore to return negated errno.
@@ -120,7 +120,7 @@ int mm_trysemaphore(FAR struct mm_heap_s *heap)
/* Try to take the semaphore (perhaps waiting) */
if (sem_trywait(&heap->mm_semaphore) != 0) {
- return ERROR;
+ return -get_errno();
}
/* We have it. Claim the stak and return */
