Module: xenomai-2.6
Branch: master
Commit: 2f997bd09a9e4f95f12430646702dd2892652512
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=2f997bd09a9e4f95f12430646702dd2892652512

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Tue Apr  5 01:12:03 2016 +0200

posix/clock_host_realtime: fix error handling

---

 src/skins/posix/clock.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/skins/posix/clock.c b/src/skins/posix/clock.c
index bfdfe72..ae7f38e 100644
--- a/src/skins/posix/clock.c
+++ b/src/skins/posix/clock.c
@@ -67,12 +67,12 @@ static int __do_clock_host_realtime(struct timespec *ts, 
void *tzp)
        struct xnvdso_hostrt_data *hostrt_data;
 
        if (!xnvdso_test_feature(XNVDSO_FEAT_HOST_REALTIME))
-               return -1;
+               return -ENODEV;
 
        hostrt_data = &nkvdso->hostrt_data;
 
        if (unlikely(!hostrt_data->live))
-               return -1;
+               return -ENODEV;
 
        /*
         * The following is essentially a verbatim copy of the
@@ -111,7 +111,7 @@ int __wrap_clock_gettime(clockid_t clock_id, struct 
timespec *tp)
        switch (clock_id) {
 #ifdef XNARCH_HAVE_NONPRIV_TSC
        case CLOCK_HOST_REALTIME:
-               err = __do_clock_host_realtime(tp, NULL);
+               err = -__do_clock_host_realtime(tp, NULL);
                break;
        case CLOCK_MONOTONIC:
                if (__pse51_sysinfo.tickval == 1) {


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

Reply via email to