Skip to content
Snippets Groups Projects
Commit 19abe47a authored by Gregory Nutt's avatar Gregory Nutt
Browse files

sem_wait: Use set_errno() and get_errno(). Direce access inside the OS may...

sem_wait: Use set_errno() and get_errno().  Direce access inside the OS may not be supported in the future.
parent 487a672d
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ int sem_wait(FAR sem_t *sem)
/* Assume any errors reported are due to invalid arguments. */
errno = EINVAL;
set_errno(EINVAL);
if (sem)
{
......@@ -168,7 +168,7 @@ int sem_wait(FAR sem_t *sem)
#endif
/* Add the TCB to the prioritized semaphore wait queue */
errno = 0;
set_errno(0);
up_block_task(rtcb, TSTATE_WAIT_SEM);
/* When we resume at this point, either (1) the semaphore has been
......@@ -191,7 +191,7 @@ int sem_wait(FAR sem_t *sem)
* race conditions.
*/
if (errno != EINTR && errno != ETIMEDOUT)
if (get_errno() != EINTR && get_errno() != ETIMEDOUT)
{
/* Not awakened by a signal or a timeout... We hold the semaphore */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment