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.

This commit is contained in:
Gregory Nutt 2015-02-24 07:29:47 -06:00
parent 0c9f7bcda6
commit 9ab0d4c56f
3 changed files with 4 additions and 4 deletions

View File

@ -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
{

View File

@ -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
{

View File

@ -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