fix wide printf forms ignoring width for %lc format specifier
[musl] / src / thread / pthread_spin_trylock.c
index c12696b..5284fda 100644 (file)
@@ -1,6 +1,7 @@
 #include "pthread_impl.h"
+#include <errno.h>
 
 int pthread_spin_trylock(pthread_spinlock_t *s)
 {
-       return -a_xchg(s, 1) & EBUSY;
+       return a_cas(s, 0, EBUSY);
 }