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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Tue Oct 28 16:09:01 2014 +0100

cobalt/posix/compat: fix sys32_get_sigevent() helper

---

 kernel/cobalt/posix/compat.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/posix/compat.c b/kernel/cobalt/posix/compat.c
index e0f9609..948616c 100644
--- a/kernel/cobalt/posix/compat.c
+++ b/kernel/cobalt/posix/compat.c
@@ -229,7 +229,7 @@ int sys32_get_sigevent(struct sigevent *ev,
                return ret;
 
        memset(ev, 0, sizeof(*ev));
-       ev->sigev_value.sival_int = cev.sigev_value.sival_int;
+       ev->sigev_value.sival_ptr = compat_ptr(cev.sigev_value.sival_ptr);
        ev->sigev_signo = cev.sigev_signo;
        ev->sigev_notify = cev.sigev_notify;
        /*
@@ -238,8 +238,8 @@ int sys32_get_sigevent(struct sigevent *ev,
         */
        p = ev->_sigev_un._pad;
        cp = cev._sigev_un._pad;
-       while ((void *)cp < (void *)cev._sigev_un._pad
-              + sizeof(cev._sigev_un._pad))
+       while (p < &ev->_sigev_un._pad[ARRAY_SIZE(ev->_sigev_un._pad)] &&
+              cp < &cev._sigev_un._pad[ARRAY_SIZE(cev._sigev_un._pad)])
                *p++ = *cp++;
 
        return 0;


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

Reply via email to