mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 13:13:08 +08:00
Revert "sem_wait.c edited online with Bitbucket. Fix some correct but useless code."
What was I thinking? I missed that litle minus sign and the possibility that the errno might be some positive non-zero value.
This reverts commit 43880878e4.
This commit is contained in:
@@ -187,7 +187,7 @@ int nxsem_wait(FAR sem_t *sem)
|
||||
* race conditions.
|
||||
*/
|
||||
|
||||
/* An error may have occurred while we were sleeping. Expected
|
||||
/* Check if an error occurred while we were sleeping. Expected
|
||||
* errors include EINTR meaning that we were awakened by a signal
|
||||
* or ETIMEDOUT meaning that the timer expired for the case of
|
||||
* sem_timedwait().
|
||||
@@ -197,7 +197,7 @@ int nxsem_wait(FAR sem_t *sem)
|
||||
* thread was restarted.
|
||||
*/
|
||||
|
||||
ret = rtcb->pterrno;
|
||||
ret = rtcb->pterrno != OK ? -rtcb->pterrno : OK;
|
||||
rtcb->pterrno = saved_errno;
|
||||
|
||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||
|
||||
Reference in New Issue
Block a user