--- libaitsched/src/hooks.c 2014/06/05 22:22:46 1.27.2.9 +++ libaitsched/src/hooks.c 2015/07/02 23:27:06 1.30 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: hooks.c,v 1.27.2.9 2014/06/05 22:22:46 misho Exp $ +* $Id: hooks.c,v 1.30 2015/07/02 23:27:06 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -12,7 +12,7 @@ terms: All of the documentation and software included in the ELWIX and AITNET Releases is copyrighted by ELWIX - Sofia/Bulgaria -Copyright 2004 - 2014 +Copyright 2004 - 2015 by Michael Pounov . All rights reserved. Redistribution and use in source and binary forms, with or without @@ -88,7 +88,8 @@ _sched_threadWrapper(sched_task_t *t) } #endif -#if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) +#if defined(HAVE_LIBRT) && defined(HAVE_TIMER_CREATE) && \ + defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) #if SUP_ENABLE == KQ_SUPPORT static void * _sched_rtcWrapper(sched_task_t *t) @@ -466,7 +467,8 @@ sched_hook_cancel(void *task, void *arg __unused) } #endif return NULL; -#if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) +#if defined(HAVE_LIBRT) && defined(HAVE_TIMER_CREATE) && \ + defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) case taskRTC: timer_delete((timer_t) TASK_FLAG(t)); #if SUP_ENABLE == KQ_SUPPORT @@ -1195,8 +1197,8 @@ fetch_hook_select_proceed(int en, fd_set rfd, fd_set w insert_task_to(task, &r->root_ready); } } - /* if match equal to 1, remove resouce */ - if (flg == 1) + /* remove resouce */ + if (flg) FD_CLR(i, &r->root_fds[0]); } @@ -1226,8 +1228,8 @@ fetch_hook_select_proceed(int en, fd_set rfd, fd_set w insert_task_to(task, &r->root_ready); } } - /* if match equal to 1, remove resouce */ - if (flg == 1) + /* remove resouce */ + if (flg) FD_CLR(i, &r->root_fds[1]); } } @@ -1452,10 +1454,11 @@ sched_hook_condition(void *root, void *arg) * @arg = unused * return: <0 errors and 0 ok */ -#if defined(HAVE_TIMER_CREATE) && defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) void * sched_hook_rtc(void *task, void *arg __unused) { +#if defined(HAVE_LIBRT) && defined(HAVE_TIMER_CREATE) && \ + defined(HAVE_TIMER_SETTIME) && defined(HAVE_TIMER_DELETE) sched_task_t *sigt = NULL, *t = task; struct itimerspec its; struct sigevent evt; @@ -1521,7 +1524,6 @@ sched_hook_rtc(void *task, void *arg __unused) timer_delete(tmr); return (void*) -1; } - +#endif /* HAVE_TIMER_CREATE */ return NULL; } -#endif /* HAVE_TIMER_CREATE */