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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Apr 23 10:39:54 2014 +0200

cobalt/posix/clock: clock_nanosleep: return EINVAL if request->tv_sec < 0

Stick to the linux behavior, even if POSIX 1003.1 does not mention
this error case.

---

 kernel/cobalt/posix/clock.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/kernel/cobalt/posix/clock.c b/kernel/cobalt/posix/clock.c
index 12bbaad..f98592c 100644
--- a/kernel/cobalt/posix/clock.c
+++ b/kernel/cobalt/posix/clock.c
@@ -261,6 +261,9 @@ int cobalt_clock_nanosleep(clockid_t clock_id, int flags,
            clock_id != CLOCK_REALTIME)
                return -EOPNOTSUPP;
 
+       if (rqt.tv_sec < 0)
+               return -EINVAL;
+
        if ((unsigned long)rqt.tv_nsec >= ONE_BILLION)
                return -EINVAL;
 


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

Reply via email to