Fix some compile problems in last commits when debug assertions are enabled.

This commit is contained in:
Gregory Nutt 2017-10-08 12:25:58 -06:00
parent 5e4f4ee788
commit c11c249e8f
2 changed files with 7 additions and 2 deletions

View File

@ -79,6 +79,7 @@ void lib_sem_initialize(FAR struct file_struct *stream)
void lib_take_semaphore(FAR struct file_struct *stream)
{
pid_t my_pid = getpid();
int ret;
/* Do I already have the semaphore? */
@ -92,13 +93,14 @@ void lib_take_semaphore(FAR struct file_struct *stream)
{
/* Take the semaphore (perhaps waiting) */
while (_SEM_WAIT(&stream->fs_sem) < 0)
while ((ret = _SEM_WAIT(&stream->fs_sem)) < 0)
{
/* The only case that an error should occr here is if the wait
* was awakened by a signal.
*/
DEBUGASSERT(_SEM_ERRNO(ret) == EINTR);
UNUSED(ret);
}
/* We have it. Claim the stak and return */

View File

@ -56,15 +56,18 @@
void stream_semtake(FAR struct streamlist *list)
{
int ret;
/* Take the semaphore (perhaps waiting) */
while (_SEM_WAIT(&list->sl_sem) != 0)
while ((ret = _SEM_WAIT(&list->sl_sem)) < 0)
{
/* The only case that an error should occr here is if
* the wait was awakened by a signal.
*/
DEBUGASSERT(_SEM_ERRNO(ret) == EINTR);
UNUSED(ret);
}
}