summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-11-19 09:49:11 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-11-19 09:49:11 -0600
commit8841cfe12b967ceefbac83427d9cc1e5c077a317 (patch)
tree184a3b2bc8f04363895dfa7ee378ebc8bc8f5732
parentcaca8f1e6a300d15ca8bd81fe39c9b6847bc8af3 (diff)
downloadnuttx-8841cfe12b967ceefbac83427d9cc1e5c077a317.tar.gz
nuttx-8841cfe12b967ceefbac83427d9cc1e5c077a317.tar.bz2
nuttx-8841cfe12b967ceefbac83427d9cc1e5c077a317.zip
Simplifed semaphore wait logic in poll()
-rw-r--r--nuttx/fs/vfs/fs_poll.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/nuttx/fs/vfs/fs_poll.c b/nuttx/fs/vfs/fs_poll.c
index 7a5de1626..26f1ebd21 100644
--- a/nuttx/fs/vfs/fs_poll.c
+++ b/nuttx/fs/vfs/fs_poll.c
@@ -74,22 +74,16 @@ static int poll_semtake(FAR sem_t *sem)
{
/* Take the semaphore (perhaps waiting) */
- while (sem_wait(sem) < 0)
+ if (sem_wait(sem) < 0)
{
int err = get_errno();
- /* The only case that an error should occur here is if the wait was
+ /* The only case that an error should occur here is if the wait were
* awakened by a signal.
*/
- ASSERT(err == EINTR);
-
- /* Received signal, break from poll wait. */
-
- if (err == EINTR)
- {
- return -EINTR;
- }
+ DEBUGASSERT(err == EINTR);
+ return -err;
}
return OK;