--- libaitsched/src/hooks.c 2014/01/28 13:01:58 1.24.4.8 +++ libaitsched/src/hooks.c 2014/01/28 16:43:41 1.25.2.1 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.24.4.8 2014/01/28 13:01:58 misho Exp $ +* $Id: hooks.c,v 1.25.2.1 2014/01/28 16:43:41 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -638,7 +638,7 @@ sched_hook_fetch(void *root, void *arg __unused) struct timespec now, m, mtmp; #ifndef KQ_DISABLE struct kevent evt[1], res[KQ_EVENTS]; - struct timespec *timeout, m, mtmp; + struct timespec *timeout; #else struct timeval *timeout, tv; fd_set rfd, wfd, xfd; @@ -1149,8 +1149,8 @@ sched_hook_fetch(void *root, void *arg __unused) continue; else { flg++; - TASK_RET(task) ^= TASK_RET(task); - TASK_FLAG(task) ^= TASK_FLAG(task); + TASK_FLAG(task) = ioctl(TASK_FD(task), + FIONREAD, &TASK_RET(task)); } /* remove read handle */ #ifdef HAVE_LIBPTHREAD @@ -1203,8 +1203,8 @@ sched_hook_fetch(void *root, void *arg __unused) continue; else { flg++; - TASK_RET(task) ^= TASK_RET(task); - TASK_FLAG(task) ^= TASK_FLAG(task); + TASK_FLAG(task) = ioctl(TASK_FD(task), + FIONWRITE, &TASK_RET(task)); } /* remove write handle */ #ifdef HAVE_LIBPTHREAD