From d5000bfdc540f418d28342ad9d5346258394dc10 Mon Sep 17 00:00:00 2001
From: patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>
Date: Mon, 17 Nov 2008 23:24:22 +0000
Subject: [PATCH] Fix improper access to table

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1271 42af7a65-404d-4744-a932-0658087f49c3
---
 fs/fs_poll.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/fs/fs_poll.c b/fs/fs_poll.c
index f28e84e269..84d20efe8a 100644
--- a/fs/fs_poll.c
+++ b/fs/fs_poll.c
@@ -163,12 +163,12 @@ static inline int poll_setup(FAR struct pollfd *fds, nfds_t nfds, sem_t *sem)
     {
       /* Setup the poll descriptor */
 
-      fds->sem     = sem;
-      fds->revents = 0;
+      fds[i].sem     = sem;
+      fds[i].revents = 0;
 
       /* Set up the poll */
 
-      ret = poll_fdsetup(fds->fd, fds);
+      ret = poll_fdsetup(fds[i].fd, &fds[i]);
       if (ret < 0)
         {
           return ret;
@@ -201,7 +201,7 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count)
     {
       /* Teardown the poll */
 
-      status = poll_fdsetup(fds->fd, NULL);
+      status = poll_fdsetup(fds[i].fd, NULL);
       if (status < 0)
         {
           ret = status;
@@ -209,14 +209,14 @@ static inline int poll_teardown(FAR struct pollfd *fds, nfds_t nfds, int *count)
 
       /* Check if any events were posted */
 
-      if (fds->revents != 0)
+      if (fds[i].revents != 0)
         {
           (*count)++;
         }
 
       /* Un-initialize the poll structure */
 
-      fds->sem = NULL;
+      fds[i].sem = NULL;
     }
   return ret;
 }
-- 
GitLab