summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2015-02-24 07:29:47 -0600
committerGregory Nutt <gnutt@nuttx.org>2015-02-24 07:29:47 -0600
commit9fb079bae02ba2a3b96a1d01736c2699b78a79d6 (patch)
tree0893968797f83eb39e6fd36565efb6f4d29a6688
parent62d3709a5962ed5cafec2aad5b3b6ed406840d60 (diff)
downloadnuttx-9fb079bae02ba2a3b96a1d01736c2699b78a79d6.tar.gz
nuttx-9fb079bae02ba2a3b96a1d01736c2699b78a79d6.tar.bz2
nuttx-9fb079bae02ba2a3b96a1d01736c2699b78a79d6.zip
fs/aio: Corrrect some backward tests in aio_read() and aio_write(): Socket descriptors have higher numbers than file descriptors. In aio_contain(), Copy u.ptr (void *) when initializing aioc and not the case specific u.aioc_filep. From Michal Ulianko.
-rw-r--r--nuttx/fs/aio/aio_read.c2
-rw-r--r--nuttx/fs/aio/aio_write.c2
-rw-r--r--nuttx/fs/aio/aioc_contain.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/nuttx/fs/aio/aio_read.c b/nuttx/fs/aio/aio_read.c
index fd05edbc6..81ee4e592 100644
--- a/nuttx/fs/aio/aio_read.c
+++ b/nuttx/fs/aio/aio_read.c
@@ -111,7 +111,7 @@ static void aio_read_worker(FAR void *arg)
aiocbp = aioc_decant(aioc);
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
- if (aiocbp->aio_fildes >= CONFIG_NFILE_DESCRIPTORS)
+ if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS)
#endif
#ifdef AIO_HAVE_FILEP
{
diff --git a/nuttx/fs/aio/aio_write.c b/nuttx/fs/aio/aio_write.c
index 6b8903895..70f40ca59 100644
--- a/nuttx/fs/aio/aio_write.c
+++ b/nuttx/fs/aio/aio_write.c
@@ -131,7 +131,7 @@ static void aio_write_worker(FAR void *arg)
aiocbp = aioc_decant(aioc);
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
- if (aiocbp->aio_fildes >= CONFIG_NFILE_DESCRIPTORS)
+ if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS)
#endif
#ifdef AIO_HAVE_FILEP
{
diff --git a/nuttx/fs/aio/aioc_contain.c b/nuttx/fs/aio/aioc_contain.c
index 54f5dcd3d..207ae7468 100644
--- a/nuttx/fs/aio/aioc_contain.c
+++ b/nuttx/fs/aio/aioc_contain.c
@@ -107,7 +107,7 @@ FAR struct aio_container_s *aio_contain(FAR struct aiocb *aiocbp)
#endif
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
- if (aiocbp->aio_fildes >= CONFIG_NFILE_DESCRIPTORS)
+ if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS)
#endif
#ifdef AIO_HAVE_FILEP
{
@@ -151,7 +151,7 @@ FAR struct aio_container_s *aio_contain(FAR struct aiocb *aiocbp)
memset(aioc, 0, sizeof(struct aio_container_s));
aioc->aioc_aiocbp = aiocbp;
- aioc->u.aioc_filep = u.ptr;
+ aioc->u.ptr = u.ptr;
aioc->aioc_pid = getpid();
#ifdef CONFIG_PRIORITY_INHERITANCE