X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fthread%2Fpthread_mutex_init.c;h=acf45a74687bcf3d8dfb6ac7d4e9107d922b4fe2;hb=2488d31f5a946e63e40058baf29fd2991343ea6f;hp=fb689271ce7affd0171368005ceebc03abcf6cff;hpb=400c5e5c8307a2ebe44ef1f203f5a15669f20347;p=musl diff --git a/src/thread/pthread_mutex_init.c b/src/thread/pthread_mutex_init.c index fb689271..acf45a74 100644 --- a/src/thread/pthread_mutex_init.c +++ b/src/thread/pthread_mutex_init.c @@ -2,7 +2,7 @@ int pthread_mutex_init(pthread_mutex_t *restrict m, const pthread_mutexattr_t *restrict a) { - memset(m, 0, sizeof *m); - if (a) m->_m_type = *a & 7; + *m = (pthread_mutex_t){0}; + if (a) m->_m_type = a->__attr; return 0; }