diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2014-11-19 09:49:11 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2014-11-19 09:49:11 -0600 |
commit | 8841cfe12b967ceefbac83427d9cc1e5c077a317 (patch) | |
tree | 184a3b2bc8f04363895dfa7ee378ebc8bc8f5732 | |
parent | caca8f1e6a300d15ca8bd81fe39c9b6847bc8af3 (diff) | |
download | nuttx-8841cfe12b967ceefbac83427d9cc1e5c077a317.tar.gz nuttx-8841cfe12b967ceefbac83427d9cc1e5c077a317.tar.bz2 nuttx-8841cfe12b967ceefbac83427d9cc1e5c077a317.zip |
Simplifed semaphore wait logic in poll()
-rw-r--r-- | nuttx/fs/vfs/fs_poll.c | 14 |
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; |