Module: xenomai-3
Branch: stable-3.0.x
Commit: c7141d6bca7e3f61c4ff0326ea638f225b9e411c
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=c7141d6bca7e3f61c4ff0326ea638f225b9e411c

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Feb  2 09:48:40 2016 +0100

cobalt/timer: fix handling of late arrival on first periodic delivery

Arriving late on the first delivery date when arming a periodic timer
is not an error, we may simply wait for the next tick. Fix the status
code accordingly.

---

 kernel/cobalt/timer.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/cobalt/timer.c b/kernel/cobalt/timer.c
index 31a431b..db6263d 100644
--- a/kernel/cobalt/timer.c
+++ b/kernel/cobalt/timer.c
@@ -141,9 +141,8 @@ int xntimer_start(struct xntimer *timer,
        default: /* XN_ABSOLUTE || XN_REALTIME */
                date = xnclock_ns_to_ticks(clock, value);
                if ((xnsticks_t)(date - now) <= 0) {
-                       ret = -ETIMEDOUT;
                        if (interval == XN_INFINITE)
-                               return ret;
+                               return -ETIMEDOUT;
                        /*
                         * We are late on arrival for the first
                         * delivery, wait for the next shot on the


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to