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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Mon Apr  7 15:53:02 2014 +0200

cobalt/posix: fixup for kernel v3.14+

---

 kernel/cobalt/include/asm-generic/xenomai/wrappers.h |    8 +++++++-
 kernel/cobalt/posix/mqueue.c                         |    2 +-
 kernel/cobalt/posix/signal.c                         |    2 +-
 3 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h 
b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
index b357545..d6a1a27 100644
--- a/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
+++ b/kernel/cobalt/include/asm-generic/xenomai/wrappers.h
@@ -45,5 +45,11 @@
 #ifndef pgprot_noncached
 #define pgprot_noncached(p) (p)
 #endif /* !pgprot_noncached */
- 
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0)
+#define get_current_uuid() current_uid()
+#else
+#define get_current_uuid() from_kuid_munged(current_user_ns(), current_uid())
+#endif
+
 #endif /* _COBALT_ASM_GENERIC_WRAPPERS_H */
diff --git a/kernel/cobalt/posix/mqueue.c b/kernel/cobalt/posix/mqueue.c
index 1cafb15..395eaf2 100644
--- a/kernel/cobalt/posix/mqueue.c
+++ b/kernel/cobalt/posix/mqueue.c
@@ -963,7 +963,7 @@ static inline int mq_notify(mqd_t fd, const struct sigevent 
*evp)
                 * into the init namespace instead.
                 */
                mq->si.si_pid = current->pid;
-               mq->si.si_uid = current_uid();
+               mq->si.si_uid = get_current_uuid();
        }
 
        xnlock_put_irqrestore(&nklock, s);
diff --git a/kernel/cobalt/posix/signal.c b/kernel/cobalt/posix/signal.c
index f1273d3..712f073 100644
--- a/kernel/cobalt/posix/signal.c
+++ b/kernel/cobalt/posix/signal.c
@@ -458,7 +458,7 @@ int __cobalt_kill(struct cobalt_thread *thread, int sig, 
int group) /* nklocked,
                        sigp->si.si_errno = 0;
                        sigp->si.si_code = SI_USER;
                        sigp->si.si_pid = current->pid;
-                       sigp->si.si_uid = current_uid();
+                       sigp->si.si_uid = get_current_uuid();
                        cobalt_signal_send(thread, sigp, group);
                }
        resched:


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

Reply via email to