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

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Jan  9 13:29:47 2014 +0100

lib/cobalt: default all extended attributes to zero

---

 lib/cobalt/attr.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/cobalt/attr.c b/lib/cobalt/attr.c
index d63873b..2d65ad6 100644
--- a/lib/cobalt/attr.c
+++ b/lib/cobalt/attr.c
@@ -19,6 +19,7 @@
 #include <stddef.h>
 #include <errno.h>
 #include <pthread.h>
+#include <memory.h>
 #include <cobalt/uapi/thread.h>
 #include "internal.h"
 
@@ -27,7 +28,9 @@ int pthread_attr_init_ex(pthread_attr_ex_t *attr_ex)
        struct sched_param param;
        int policy;
 
-       /* We start with the default standard attribute set. */
+       /* Start with defaulting all fields to null. */
+       memset(attr_ex, 0, sizeof(*attr_ex));
+       /* Merge in the default standard attribute set. */
        pthread_attr_init(&attr_ex->std);
        pthread_attr_getschedpolicy(&attr_ex->std, &policy);
        attr_ex->nonstd.sched_policy = policy;


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

Reply via email to