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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep  4 12:30:47 2013 +0200

lib/cobalt: fix error propagation from thread trampoline

---

 lib/cobalt/thread.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/cobalt/thread.c b/lib/cobalt/thread.c
index 4022fe7..d512259 100644
--- a/lib/cobalt/thread.c
+++ b/lib/cobalt/thread.c
@@ -255,8 +255,8 @@ static void *__pthread_trampoline(void *p)
         * Do _not_ inline the call to pthread_self() in the syscall
         * macro: this trashes the syscall regs on some archs.
         */
-       ret = XENOMAI_SKINCALL4(__cobalt_muxid, sc_cobalt_thread_create, tid,
-                               policy, &param_ex, &u_winoff);
+       ret = -XENOMAI_SKINCALL4(__cobalt_muxid, sc_cobalt_thread_create, tid,
+                                policy, &param_ex, &u_winoff);
        if (ret == 0) {
                cobalt_set_current();
                cobalt_set_current_window(u_winoff);
@@ -269,10 +269,10 @@ static void *__pthread_trampoline(void *p)
         * on before we actually get the CPU back.
         */
 sync_with_creator:
-       iargs->ret = -ret;
+       iargs->ret = ret;
        __STD(sem_post(&iargs->sync));
        if (ret)
-               return (void *)-ret;
+               return (void *)ret;
 
        /*
         * If the parent thread runs with the same priority as we do,


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

Reply via email to