mirror of
https://github.com/apache/nuttx.git
synced 2026-09-20 04:47:58 +08:00
Fix some compile problems in last commits when debug assertions are enabled.
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user