--- libaitsched/src/tasks.c 2012/01/24 14:04:58 1.4.2.3 +++ libaitsched/src/tasks.c 2012/01/24 15:29:09 1.4.2.4 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: tasks.c,v 1.4.2.3 2012/01/24 14:04:58 misho Exp $ +* $Id: tasks.c,v 1.4.2.4 2012/01/24 15:29:09 misho Exp $ * ************************************************************************** The ELWIX and AITNET software is distributed under the following @@ -250,12 +250,12 @@ schedTimer(sched_root_task_t * __restrict root, sched_ clock_gettime(CLOCK_MONOTONIC, &now); now.tv_sec += ts.tv_sec; now.tv_nsec += ts.tv_nsec; - if (now.tv_nsec >= 1000000000) { + if (now.tv_nsec >= 1000000000L) { now.tv_sec++; - now.tv_nsec -= 1000000000; + now.tv_nsec -= 1000000000L; } else if (now.tv_nsec < 0) { now.tv_sec--; - now.tv_nsec += 1000000000; + now.tv_nsec += 1000000000L; } TASK_TS(task) = now; @@ -272,7 +272,7 @@ schedTimer(sched_root_task_t * __restrict root, sched_ TAILQ_INSERT_TAIL(&root->root_timer, task, task_node); #else TAILQ_FOREACH(t, &root->root_timer, task_node) - if (timespeccmp(&TASK_TS(task), &TASK_TS(t), -) < 1) + if (sched_timespeccmp(&TASK_TS(task), &TASK_TS(t), -) < 1) break; if (!t) TAILQ_INSERT_TAIL(&root->root_timer, task, task_node);