--- libaitsched/src/hooks.c 2012/08/01 14:49:37 1.10.2.4 +++ libaitsched/src/hooks.c 2012/08/01 15:17:38 1.10.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.10.2.4 2012/08/01 14:49:37 misho Exp $ +* $Id: hooks.c,v 1.10.2.5 2012/08/01 15:17:38 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -454,7 +454,7 @@ sched_hook_fetch(void *root, void *arg __unused) register int i, flg; int en; #ifdef EVFILT_AIO - int len; + int len, fd; struct aiocb *acb; #endif @@ -800,15 +800,16 @@ sched_hook_fetch(void *root, void *arg __unused) #ifdef HAVE_LIBPTHREAD pthread_mutex_unlock(&r->root_mtx[taskREADY]); #endif + fd = acb->aio_fildes; if ((len = aio_return(acb)) != -1) { - if (lseek(acb->aio_fildes, acb->aio_offset + len, - SEEK_CUR) == -1) + if (lseek(fd, acb->aio_offset + len, SEEK_CUR) == -1) LOGERR; } else LOGERR; free(acb); - TASK_VAL(task) = (u_long) len; + TASK_FD(task) = (u_long) fd; + TASK_DATLEN(task) = (u_long) len; } /* if match at least 2, don't remove resouce of event */ if (flg > 1)