Module: xenomai-3
Branch: next
Commit: a94d4232f1b1a910355cd1df687f7b88ec6a2578
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a94d4232f1b1a910355cd1df687f7b88ec6a2578

Author: Jan Kiszka <jan.kis...@siemens.com>
Date:   Mon Feb 22 18:27:27 2016 +0100

cobalt/posix/timer: Allow extension to override timer_gettimeout value

Move the call into a potential cobalt extension to the front so that
it can completely control the value returned by timer_gettimeout.

Signed-off-by: Jan Kiszka <jan.kis...@siemens.com>

---

 kernel/cobalt/posix/timer.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/posix/timer.c b/kernel/cobalt/posix/timer.c
index 8c4d2da..b4cd511 100644
--- a/kernel/cobalt/posix/timer.c
+++ b/kernel/cobalt/posix/timer.c
@@ -286,6 +286,10 @@ timer_gettimeout(struct cobalt_timer *__restrict__ timer,
 {
        int ret = 0;
 
+       if (cobalt_call_extension(timer_gettime, &timer->extref,
+                                 ret, value) && ret != 0)
+               return;
+
        if (!xntimer_running_p(&timer->timerbase)) {
                value->it_value.tv_sec = 0;
                value->it_value.tv_nsec = 0;
@@ -294,9 +298,7 @@ timer_gettimeout(struct cobalt_timer *__restrict__ timer,
                return;
        }
 
-       if (!cobalt_call_extension(timer_gettime, &timer->extref,
-                                  ret, value) || ret == 0)
-               __cobalt_timer_getval(&timer->timerbase, value);
+       __cobalt_timer_getval(&timer->timerbase, value);
 }
 
 int __cobalt_timer_setval(struct xntimer *__restrict__ timer, int clock_flag,


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

Reply via email to