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

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Fri Oct  2 23:01:09 2015 +0200

cobalt/cond: fix autoinit

Drop comparison with PTHREAD_COND_INITIALIZER, as the structure
contains 4 bytes of padding for external alignment on ARM, which are
not initialized by PTHREAD_COND_INITIALIZER. The memcmp may fail whereas
the pthread_cond_t structure is correctly initialized.

---

 lib/cobalt/cond.c |    5 -----
 1 file changed, 5 deletions(-)

diff --git a/lib/cobalt/cond.c b/lib/cobalt/cond.c
index bb9e84c..0760f04 100644
--- a/lib/cobalt/cond.c
+++ b/lib/cobalt/cond.c
@@ -191,11 +191,6 @@ static void __pthread_cond_cleanup(void *data)
 
 static int __attribute__((cold)) cobalt_cond_autoinit(pthread_cond_t *cond)
 {
-       static pthread_cond_t uninit_cond = PTHREAD_COND_INITIALIZER;
-
-       if (memcmp(cond, &uninit_cond, sizeof(*cond)))
-               return EINVAL;
-
        return __COBALT(pthread_cond_init(cond, NULL));
 }
 


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

Reply via email to