diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-08-24 12:04:43 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2010-08-24 12:04:43 +0000 |
commit | 89dbb28bd4c1f4240a84efedab75eebe083647b8 (patch) | |
tree | 6374a7075186c731f1366461cd971458d2915887 /cpukit | |
parent | 2010-09-24 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-89dbb28bd4c1f4240a84efedab75eebe083647b8.tar.bz2 |
2010-09-24 Ralf Corsépius <ralf.corsepius@rtems.org>
* posix/src/aio_cancel.c: Spray pthread_mutex_unlocks.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 2 | ||||
-rw-r--r-- | cpukit/posix/src/aio_cancel.c | 14 |
2 files changed, 9 insertions, 7 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index bf4f75df26..5c02350a51 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,6 @@ 2010-09-24 Ralf Corsépius <ralf.corsepius@rtems.org> + * posix/src/aio_cancel.c: Spray pthread_mutex_unlocks. * posix/src/aio_read.c: aio_nbytes is always >= 0. * posix/src/aio_write.c: aio_nbytes is always >= 0. Fix typo in comment. @@ -31,7 +32,6 @@ 2010-08-23 Joel Sherrill <joel.sherrill@oarcorp.com> - CID 79/DEADCODE CID 78/DEADCODE CID 77/DEADCODE diff --git a/cpukit/posix/src/aio_cancel.c b/cpukit/posix/src/aio_cancel.c index d9a982cf31..7006f793c7 100644 --- a/cpukit/posix/src/aio_cancel.c +++ b/cpukit/posix/src/aio_cancel.c @@ -45,9 +45,11 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) if (aiocbp == NULL) { - if (fcntl (fildes, F_GETFL) < 0) + if (fcntl (fildes, F_GETFL) < 0) { + pthread_mutex_unlock(&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EBADF); - + } + r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); @@ -58,8 +60,10 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); - if (r_chain == NULL) + if (r_chain == NULL) { + pthread_mutex_unlock(&aio_request_queue.mutex); return AIO_ALLDONE; + } rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); @@ -84,8 +88,7 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) } else { - if (aiocbp->aio_fildes != fildes) - { + if (aiocbp->aio_fildes != fildes) { pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } @@ -120,5 +123,4 @@ int aio_cancel(int fildes, struct aiocb *aiocbp) } return AIO_ALLDONE; - } |