[Xenomai-git] Jan Kiszka : cobalt/posix/timer: Set error return codes

2015-07-04 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 8cf8675a0e1e80bbc2d31350e7547859f02138e2
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=8cf8675a0e1e80bbc2d31350e7547859f02138e2

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Thu Jul  2 18:16:22 2015 +0200

cobalt/posix/timer: Set error return codes

These error exit paths incorrectly returned the positive timer ID so
far, although the timer is deleted on error.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 kernel/cobalt/posix/timer.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/cobalt/posix/timer.c b/kernel/cobalt/posix/timer.c
index 0adc112..e5551b3 100644
--- a/kernel/cobalt/posix/timer.c
+++ b/kernel/cobalt/posix/timer.c
@@ -163,8 +163,10 @@ static inline int timer_create(clockid_t clockid,
signo = 0; /* Don't notify. */
else {
signo = evp-sigev_signo;
-   if (signo  1 || signo  _NSIG)
+   if (signo  1 || signo  _NSIG) {
+   ret = -EINVAL;
goto fail;
+   }
timer-sigp.si.si_value = evp-sigev_value;
}
}
@@ -174,8 +176,10 @@ static inline int timer_create(clockid_t clockid,
timer-id = timer_id;
 
target = timer_init(timer, evp);
-   if (target == NULL)
+   if (target == NULL) {
+   ret = -EPERM;
goto fail;
+   }
 
if (IS_ERR(target)) {
ret = PTR_ERR(target);


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


[Xenomai-git] Jan Kiszka : cobalt/kernel: Print suspension mask as hex in traces

2015-07-04 Thread git repository hosting
Module: xenomai-3
Branch: next
Commit: 237d20eba30f9d53dec65dfe217c513511f9288b
URL:
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=237d20eba30f9d53dec65dfe217c513511f9288b

Author: Jan Kiszka jan.kis...@siemens.com
Date:   Mon Jun 29 09:39:33 2015 +0200

cobalt/kernel: Print suspension mask as hex in traces

Aligns cobalt_thread_suspend with cobalt_thread_resume and makes traces
easier readable.

Signed-off-by: Jan Kiszka jan.kis...@siemens.com

---

 kernel/cobalt/trace/cobalt-core.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/trace/cobalt-core.h 
b/kernel/cobalt/trace/cobalt-core.h
index dc23588..ee20b7c 100644
--- a/kernel/cobalt/trace/cobalt-core.h
+++ b/kernel/cobalt/trace/cobalt-core.h
@@ -251,7 +251,7 @@ TRACE_EVENT(cobalt_thread_suspend,
__entry-wchan = wchan;
),
 
-   TP_printk(thread=%p mask=%lu timeout=%Lu timeout_mode=%d wchan=%p,
+   TP_printk(thread=%p mask=0x%lx timeout=%Lu timeout_mode=%d wchan=%p,
  __entry-thread, __entry-mask,
  __entry-timeout, __entry-timeout_mode, __entry-wchan)
 );


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