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:
parent
0c9f7bcda6
commit
9ab0d4c56f
@ -111,7 +111,7 @@ static void aio_read_worker(FAR void *arg)
|
|||||||
aiocbp = aioc_decant(aioc);
|
aiocbp = aioc_decant(aioc);
|
||||||
|
|
||||||
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
|
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
|
||||||
if (aiocbp->aio_fildes >= CONFIG_NFILE_DESCRIPTORS)
|
if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS)
|
||||||
#endif
|
#endif
|
||||||
#ifdef AIO_HAVE_FILEP
|
#ifdef AIO_HAVE_FILEP
|
||||||
{
|
{
|
||||||
|
@ -131,7 +131,7 @@ static void aio_write_worker(FAR void *arg)
|
|||||||
aiocbp = aioc_decant(aioc);
|
aiocbp = aioc_decant(aioc);
|
||||||
|
|
||||||
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
|
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
|
||||||
if (aiocbp->aio_fildes >= CONFIG_NFILE_DESCRIPTORS)
|
if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS)
|
||||||
#endif
|
#endif
|
||||||
#ifdef AIO_HAVE_FILEP
|
#ifdef AIO_HAVE_FILEP
|
||||||
{
|
{
|
||||||
|
@ -107,7 +107,7 @@ FAR struct aio_container_s *aio_contain(FAR struct aiocb *aiocbp)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
|
#if defined(AIO_HAVE_FILEP) && defined(AIO_HAVE_PSOCK)
|
||||||
if (aiocbp->aio_fildes >= CONFIG_NFILE_DESCRIPTORS)
|
if (aiocbp->aio_fildes < CONFIG_NFILE_DESCRIPTORS)
|
||||||
#endif
|
#endif
|
||||||
#ifdef AIO_HAVE_FILEP
|
#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));
|
memset(aioc, 0, sizeof(struct aio_container_s));
|
||||||
aioc->aioc_aiocbp = aiocbp;
|
aioc->aioc_aiocbp = aiocbp;
|
||||||
aioc->u.aioc_filep = u.ptr;
|
aioc->u.ptr = u.ptr;
|
||||||
aioc->aioc_pid = getpid();
|
aioc->aioc_pid = getpid();
|
||||||
|
|
||||||
#ifdef CONFIG_PRIORITY_INHERITANCE
|
#ifdef CONFIG_PRIORITY_INHERITANCE
|
||||||
|
Loading…
Reference in New Issue
Block a user