X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;ds=sidebyside;f=src%2Fthread%2Fpthread_cond_init.c;h=8c484ddcded2a10acb6bc9ce4e8dcaf43eb24e39;hb=80bf5952551c002cf12d96deb145629765272db0;hp=03aff76840a8d15b7877fdb72f690980f753fab1;hpb=cba4e1c0a3423ed07ef5c79f6e29360996f32fd7;p=musl diff --git a/src/thread/pthread_cond_init.c b/src/thread/pthread_cond_init.c index 03aff768..8c484ddc 100644 --- a/src/thread/pthread_cond_init.c +++ b/src/thread/pthread_cond_init.c @@ -1,11 +1,11 @@ #include "pthread_impl.h" -int pthread_cond_init(pthread_cond_t *c, const pthread_condattr_t *a) +int pthread_cond_init(pthread_cond_t *restrict c, const pthread_condattr_t *restrict a) { - memset(c, 0, sizeof *c); + *c = (pthread_cond_t){0}; if (a) { - c->_c_clock = *a & 0x7fffffff; - if (*a>>31) c->_c_mutex = (void *)-1; + c->_c_clock = a->__attr & 0x7fffffff; + if (a->__attr>>31) c->_c_shared = (void *)-1; } return 0; }