summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/aio_misc.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-21 10:15:02 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-07-22 09:13:07 +0200
commit059529e685e059d366ee56aa6117ee0d4e899e66 (patch)
tree77255d92003c98d84f558f6dbc27d474a842cf83 /cpukit/posix/src/aio_misc.c
parentposix: Fix double chain extract (diff)
downloadrtems-059529e685e059d366ee56aa6117ee0d4e899e66.tar.bz2
score: Add debug support to chains
This helps to detect * double insert, append, prepend errors, and * get from empty chain errors.
Diffstat (limited to 'cpukit/posix/src/aio_misc.c')
-rw-r--r--cpukit/posix/src/aio_misc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cpukit/posix/src/aio_misc.c b/cpukit/posix/src/aio_misc.c
index bdcd0d38d8..5a281a94f5 100644
--- a/cpukit/posix/src/aio_misc.c
+++ b/cpukit/posix/src/aio_misc.c
@@ -116,6 +116,7 @@ rtems_aio_search_fd (rtems_chain_control *chain, int fildes, int create)
else {
r_chain = malloc (sizeof (rtems_aio_request_chain));
rtems_chain_initialize_empty (&r_chain->perfd);
+ rtems_chain_initialize_node (&r_chain->next_fd);
if (rtems_chain_is_empty (chain))
rtems_chain_prepend (chain, &r_chain->next_fd);
@@ -222,9 +223,9 @@ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain)
while (!rtems_chain_is_tail (chain, node))
{
- rtems_chain_extract (node);
rtems_aio_request *req = (rtems_aio_request *) node;
node = rtems_chain_next (node);
+ rtems_chain_extract (&req->next_prio);
req->aiocbp->error_code = ECANCELED;
req->aiocbp->return_value = -1;
free (req);
@@ -311,6 +312,7 @@ rtems_aio_enqueue (rtems_aio_request *req)
we can use aio_reqprio to lower the priority of the request */
pthread_getschedparam (pthread_self(), &policy, &param);
+ rtems_chain_initialize_node (&req->next_prio);
req->caller_thread = pthread_self ();
req->priority = param.sched_priority - req->aiocbp->aio_reqprio;
req->policy = policy;