Module: xenomai-3
Branch: arm64
Commit: a792041f32220080ff19ceb47c97d5fb9155dad2
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=a792041f32220080ff19ceb47c97d5fb9155dad2

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 19ef372..7eeb9e6 100644
--- a/lib/cobalt/cond.c
+++ b/lib/cobalt/cond.c
@@ -194,11 +194,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