From 6c48b5358c5815bba9f80493a6581229dc131b9b Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 8 Jan 2011 21:01:32 +0000 Subject: 2011-01-08 Alin Rus * posix/src/aio_misc.c: Fix rtems_aio_remove_req did not iterate over chain. * posix/src/aio_cancel.c: Add debug information. Add check for bad file descriptor. Add else branch for cancel request on empty IQ chain. --- cpukit/posix/src/aio_misc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cpukit/posix/src/aio_misc.c') diff --git a/cpukit/posix/src/aio_misc.c b/cpukit/posix/src/aio_misc.c index b9d12244cb..038765e9a5 100644 --- a/cpukit/posix/src/aio_misc.c +++ b/cpukit/posix/src/aio_misc.c @@ -179,7 +179,6 @@ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) { rtems_chain_control *chain; rtems_chain_node *node; - chain = &r_chain->perfd; node = rtems_chain_first (chain); @@ -187,6 +186,7 @@ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; + node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; req->aiocbp->return_value = -1; free (req); @@ -211,6 +211,9 @@ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { + if (rtems_chain_is_empty (chain)) + return AIO_ALLDONE; + rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; -- cgit v1.2.3